ILIAS  release_8 Revision v8.24
ilTermsOfServiceCriterionBaseTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\MockObject\MockObject;
22
28{
32 protected function getRbacReviewMock(): ilRbacReview
33 {
34 $rbacReview = $this
35 ->getMockBuilder(ilRbacReview::class)
36 ->disableOriginalConstructor()
37 ->onlyMethods(['isGlobalRole', 'isAssigned', 'getGlobalRoles'])
38 ->getMock();
39
40 $rbacReview
41 ->method('getGlobalRoles')
42 ->willReturn([2, 4]);
43
44 return $rbacReview;
45 }
46
51 {
52 $objectDataCache = $this
53 ->getMockBuilder(ilObjectDataCache::class)
54 ->disableOriginalConstructor()
55 ->getMock();
56
57 return $objectDataCache;
58 }
59
64 {
65 $radioGroup = $this
66 ->getMockBuilder(ilRadioGroupInputGUI::class)
67 ->disableOriginalConstructor()
68 ->onlyMethods(['getPostVar'])
69 ->getMock();
70
71 return $radioGroup;
72 }
73
77 protected function getFormMock(): ilPropertyFormGUI
78 {
79 $form = $this
80 ->getMockBuilder(ilPropertyFormGUI::class)
81 ->disableOriginalConstructor()
82 ->onlyMethods(['getInput'])
83 ->getMock();
84
85 return $form;
86 }
87
91 protected function getUserMock(): ilObjUser
92 {
93 $user = $this
94 ->getMockBuilder(ilObjUser::class)
95 ->disableOriginalConstructor()
96 ->onlyMethods(['getLanguage', 'getId', 'getLogin', 'getSelectedCountry'])
97 ->getMock();
98
99 $user
100 ->method('getId')
101 ->willReturn(-1);
102
103 $user
104 ->method('getLogin')
105 ->willReturn('phpunit');
106
107 return $user;
108 }
109}
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
This class represents a property in a property form.
class ilRbacReview Contains Review functions of core Rbac.
Class ilTermsOfServiceBaseTest.
Class ilTermsOfServiceCriterionBaseTest.