ILIAS  release_8 Revision v8.24
ilTermsOfServiceAcceptanceHistoryGUITest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24use ILIAS\Refinery\Factory as Refinery;
25use PHPUnit\Framework\MockObject\MockObject;
26
32{
42 protected ilLanguage $lng;
54 protected Refinery $refinery;
57
58 protected function setUp(): void
59 {
60 parent::setUp();
61
62 $this->tos = $this->getMockBuilder(ilObjTermsOfService::class)->disableOriginalConstructor()->getMock();
63 $this->criterionTypeFactory = $this->getMockBuilder(ilTermsOfServiceCriterionTypeFactoryInterface::class)->disableOriginalConstructor()->getMock();
64 $this->tpl = $this->getMockBuilder(ilGlobalTemplateInterface::class)->getMock();
65 $this->ctrl = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->getMock();
66 $this->lng = $this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock();
67 $this->rbacsystem = $this->getMockBuilder(ilRbacSystem::class)->disableOriginalConstructor()->getMock();
68 $this->error = $this->getMockBuilder(ilErrorHandling::class)->disableOriginalConstructor()->getMock();
69 $this->http = $this->getMockBuilder(GlobalHttpState::class)->disableOriginalConstructor()->getMock();
70 $this->refinery = $this->getMockBuilder(Refinery::class)->disableOriginalConstructor()->getMock();
71 $this->uiFactory = $this->getMockBuilder(Factory::class)->disableOriginalConstructor()->getMock();
72 $this->uiRenderer = $this->getMockBuilder(Renderer::class)->disableOriginalConstructor()->getMock();
73 $this->tableDataProviderFactory = $this->getMockBuilder(ilTermsOfServiceTableDataProviderFactory::class)->disableOriginalConstructor()->getMock();
74 }
75
77 {
78 $this->ctrl
79 ->method('getCmd')
80 ->willReturnOnConsecutiveCalls(
81 'showAcceptanceHistory'
82 );
83
84 $this->rbacsystem
85 ->method('checkAccess')
86 ->willReturn(false);
87
88 $this->error
89 ->method('raiseError')
90 ->willThrowException(new ilException('no_permission'));
91
93 $this->tos,
94 $this->criterionTypeFactory,
95 $this->tpl,
96 $this->ctrl,
97 $this->lng,
98 $this->rbacsystem,
99 $this->error,
100 $this->http,
101 $this->refinery,
102 $this->uiFactory,
103 $this->uiRenderer,
104 $this->tableDataProviderFactory
105 );
106
107 $this->expectException(ilException::class);
108
109 $gui->executeCommand();
110 }
111}
Builds data types.
Definition: Factory.php:21
error(string $a_errmsg)
Error Handling & global info handling uses PEAR error class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language handling
Class ilObjTermsOfService.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
Class ilTermsOfServiceAcceptanceHistoryGUITest.
ilTermsOfServiceTableDataProviderFactory $tableDataProviderFactory
ilTermsOfServiceCriterionTypeFactoryInterface $criterionTypeFactory
Class ilTermsOfServiceBaseTest.
Interface GlobalHttpState.
This is how the factory for UI elements looks.
Definition: Factory.php:38
An entity that renders components to a string output.
Definition: Renderer.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.