ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTermsOfServiceCriterionBaseTest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
9 {
13  protected function getRbacReviewMock() : \ilRbacReview
14  {
15  $rbacReview = $this
16  ->getMockBuilder(\ilRbacReview::class)
17  ->disableOriginalConstructor()
18  ->setMethods(['isGlobalRole', 'isAssigned', 'getGlobalRoles'])
19  ->getMock();
20 
21  $rbacReview
22  ->expects($this->any())
23  ->method('getGlobalRoles')
24  ->willReturn([2, 4]);
25 
26  return $rbacReview;
27  }
28 
32  protected function getObjectDataCacheMock() : \ilObjectDataCache
33  {
34  $objectDataCache = $this
35  ->getMockBuilder(\ilObjectDataCache::class)
36  ->disableOriginalConstructor()
37  ->getMock();
38 
39  return $objectDataCache;
40  }
41 
45  protected function getRadioGroupMock() : \ilRadioGroupInputGUI
46  {
47  $radioGroup = $this
48  ->getMockBuilder(\ilRadioGroupInputGUI::class)
49  ->disableOriginalConstructor()
50  ->setMethods(['getPostVar'])
51  ->getMock();
52 
53  return $radioGroup;
54  }
55 
59  protected function getFormMock() : \ilPropertyFormGUI
60  {
61  $form = $this
62  ->getMockBuilder(\ilPropertyFormGUI::class)
63  ->disableOriginalConstructor()
64  ->setMethods(['getInput'])
65  ->getMock();
66 
67  return $form;
68  }
69 
73  protected function getUserMock() : \ilObjUser
74  {
75  $user = $this
76  ->getMockBuilder(\ilObjUser::class)
77  ->disableOriginalConstructor()
78  ->setMethods(['getLanguage', 'getId', 'getLogin'])
79  ->getMock();
80 
81  $user
82  ->expects($this->any())
83  ->method('getId')
84  ->willReturn(-1);
85 
86  $user
87  ->expects($this->any())
88  ->method('getLogin')
89  ->willReturn('phpunit');
90 
91  return $user;
92  }
93 }
This class represents a property form user interface.
Class ilTermsOfServiceCriterionBaseTest.
class ilObjectDataCache
Class ilTermsOfServiceBaseTest.
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
$user
Definition: migrateto20.php:57
class ilRbacReview Contains Review functions of core Rbac.