3 declare(strict_types=1);
24 $this->expectException(ilCtrlException::class);
25 $this->expectExceptionMessage(ilCtrl::class .
"::callBaseClass was not given a baseclass and the request doesn't include one either.");
26 $ctrl->callBaseClass();
31 $structure = $this->createMock(ilCtrlStructureInterface::class);
33 ->method(
'isBaseClass')
39 $this->createMock(ilCtrlTokenRepositoryInterface::class),
40 $this->createMock(ilCtrlPathFactoryInterface::class),
41 $this->createMock(ilCtrlContextInterface::class),
42 $this->createMock(ResponseSenderStrategy::class),
43 $this->createMock(ServerRequestInterface::class),
44 $this->createMock(RequestWrapper::class),
45 $this->createMock(RequestWrapper::class),
46 $this->createMock(Refinery::class),
47 $this->createMock(ilComponentFactory::class),
48 $this->createMock(ilCtrlQueryParserInterface::class)
51 $invalid_baseclass = ilCtrlInvalidGuiClass::class;
53 $this->expectException(ilCtrlException::class);
54 $this->expectExceptionMessage(
"Provided class '$invalid_baseclass' is not a baseclass");
55 $ctrl->callBaseClass($invalid_baseclass);
62 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
64 $this->expectException(ilCtrlException::class);
65 $this->expectExceptionMessage(ilCtrlInvalidGuiClass::class .
" doesn't implement executeCommand().");
73 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass1TestGUI.php';
76 ilCtrlCommandClass1TestGUI::class,
85 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
87 $this->expectException(ilCtrlException::class);
88 $this->expectExceptionMessage(ilCtrlInvalidGuiClass::class .
" doesn't implement getHTML().");
96 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass2TestGUI.php';
105 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass2TestGUI.php';
115 $this->assertEmpty($ctrl->getCmd());
121 $this->createMock(ilCtrlStructureInterface::class),
122 $this->createMock(ilCtrlTokenRepositoryInterface::class),
123 $this->createMock(ilCtrlPathFactoryInterface::class),
124 $this->createMock(ilCtrlContextInterface::class),
125 $this->createMock(ResponseSenderStrategy::class),
126 $this->createMock(ServerRequestInterface::class),
127 $this->createMock(RequestWrapper::class),
128 $this->createMock(RequestWrapper::class),
129 $this->createMock(Refinery::class),
130 $this->createMock(ilComponentFactory::class),
131 $this->createMock(ilCtrlQueryParserInterface::class)
134 $fallback_cmd =
'fallback_cmd_test';
138 $ctrl->getCmd($fallback_cmd)
210 $this->createMock(ilCtrlStructureInterface::class),
211 $this->createMock(ilCtrlTokenRepositoryInterface::class),
212 $this->createMock(ilCtrlPathFactoryInterface::class),
213 $this->createMock(ilCtrlContextInterface::class),
214 $this->createMock(ResponseSenderStrategy::class),
215 $this->createMock(ServerRequestInterface::class),
216 $this->createMock(RequestWrapper::class),
217 $this->createMock(RequestWrapper::class),
218 $this->createMock(Refinery::class),
219 $this->createMock(ilComponentFactory::class),
220 $this->createMock(ilCtrlQueryParserInterface::class)
testForwardCommandWithInvalidObject()
Class ilCtrlInvalidGuiClass.
testCallBaseClassWithoutBaseClass()
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testGetHtmlWithValidObjectAndParameters()
testGetCmdWithoutProvidedCmdAndFallback()
testForwardCommandWithValidObject()
Class ilCtrlCommandClass2TestGUI.
testGetHtmlWithInvalidObject()
testGetCmdWithoutProvidedCmd()
testGetHtmlWithValidObject()
testCallBaseClassWithInvalidProvidedBaseClass()