ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTermsOfServiceAcceptanceHistoryGUITest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 
32 {
42  protected ilLanguage $lng;
48  protected Factory $uiFactory;
50  protected Renderer $uiRenderer;
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 }
Interface GlobalHttpState.
An entity that renders components to a string output.
Definition: Renderer.php:30
Class ilTermsOfServiceBaseTest.
static http()
Fetches the global http state from ILIAS.
ilTermsOfServiceTableDataProviderFactory $tableDataProviderFactory
ilTermsOfServiceCriterionTypeFactoryInterface $criterionTypeFactory
Class ilTermsOfServiceAcceptanceHistoryGUITest.
Error Handling & global info handling uses PEAR error class.
Class ilObjTermsOfService.