ILIAS  release_7 Revision v7.30-3-g800a261c036
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
4use PHPUnit\Framework\MockObject\MockObject;
5
11{
16 protected function getRbacReviewMock() : ilRbacReview
17 {
18 $rbacReview = $this
19 ->getMockBuilder(ilRbacReview::class)
20 ->disableOriginalConstructor()
21 ->onlyMethods(['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
51 {
52 $radioGroup = $this
53 ->getMockBuilder(ilRadioGroupInputGUI::class)
54 ->disableOriginalConstructor()
55 ->onlyMethods(['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 ->onlyMethods(['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 ->onlyMethods(['getLanguage', 'getId', 'getLogin', 'getSelectedCountry'])
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}
An exception for terminatinating execution or to throw for unit testing.
class ilObjectDataCache
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.