ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceCriterionBaseTest.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
5 
11 {
16  protected function getRbacReviewMock() : ilRbacReview
17  {
18  $rbacReview = $this
19  ->getMockBuilder(ilRbacReview::class)
20  ->disableOriginalConstructor()
21  ->setMethods(['isGlobalRole', 'isAssigned', 'getGlobalRoles'])
22  ->getMock();
23 
24  $rbacReview
25  ->expects($this->any())
26  ->method('getGlobalRoles')
27  ->willReturn([2, 4]);
28 
29  return $rbacReview;
30  }
31 
37  {
38  $objectDataCache = $this
39  ->getMockBuilder(ilObjectDataCache::class)
40  ->disableOriginalConstructor()
41  ->getMock();
42 
43  return $objectDataCache;
44  }
45 
50  protected function getRadioGroupMock() : ilRadioGroupInputGUI
51  {
52  $radioGroup = $this
53  ->getMockBuilder(ilRadioGroupInputGUI::class)
54  ->disableOriginalConstructor()
55  ->setMethods(['getPostVar'])
56  ->getMock();
57 
58  return $radioGroup;
59  }
60 
65  protected function getFormMock() : ilPropertyFormGUI
66  {
67  $form = $this
68  ->getMockBuilder(ilPropertyFormGUI::class)
69  ->disableOriginalConstructor()
70  ->setMethods(['getInput'])
71  ->getMock();
72 
73  return $form;
74  }
75 
80  protected function getUserMock() : ilObjUser
81  {
82  $user = $this
83  ->getMockBuilder(ilObjUser::class)
84  ->disableOriginalConstructor()
85  ->setMethods(['getLanguage', 'getId', 'getLogin'])
86  ->getMock();
87 
88  $user
89  ->expects($this->any())
90  ->method('getId')
91  ->willReturn(-1);
92 
93  $user
94  ->expects($this->any())
95  ->method('getLogin')
96  ->willReturn('phpunit');
97 
98  return $user;
99  }
100 }
This class represents a property form user interface.
Class ilTermsOfServiceCriterionBaseTest.
class ilObjectDataCache
Class ilTermsOfServiceBaseTest.
This class represents a property in a property form.
class ilRbacReview Contains Review functions of core Rbac.