19declare(strict_types=1);
22use PHPUnit\Framework\TestCase;
24use Psr\Http\Message\ServerRequestInterface;
39 $this->expectException(ilCtrlException::class);
40 $this->expectExceptionMessage(ilCtrl::class .
"::callBaseClass was not given a baseclass and the request doesn't include one either.");
41 $ctrl->callBaseClass();
46 $structure = $this->createMock(ilCtrlStructureInterface::class);
48 ->method(
'isBaseClass')
54 $this->createStub(ilCtrlTokenRepositoryInterface::class),
55 $this->createStub(ilCtrlPathFactoryInterface::class),
56 $this->createStub(ilCtrlContextInterface::class),
57 $this->createStub(ResponseSenderStrategy::class),
58 $this->createStub(ServerRequestInterface::class),
59 $this->createStub(RequestWrapper::class),
60 $this->createStub(RequestWrapper::class),
61 $this->createStub(Refinery::class),
62 $this->createStub(ilComponentFactory::class),
64 $this->createStub(ilCtrlQueryParserInterface::class),
65 $this->createStub(MessageFactory::class),
68 $invalid_baseclass = ilCtrlInvalidGuiClass::class;
70 $this->expectException(ilCtrlException::class);
71 $this->expectExceptionMessage(
"Provided class '$invalid_baseclass' is not a baseclass");
72 $ctrl->callBaseClass($invalid_baseclass);
79 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
81 $this->expectException(ilCtrlException::class);
82 $this->expectExceptionMessage(ilCtrlInvalidGuiClass::class .
" doesn't implement executeCommand().");
90 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass1TestGUI.php';
93 ilCtrlCommandClass1TestGUI::class,
102 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
104 $this->expectException(ilCtrlException::class);
105 $this->expectExceptionMessage(ilCtrlInvalidGuiClass::class .
" doesn't implement getHTML().");
113 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass2TestGUI.php';
122 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass2TestGUI.php';
132 $this->assertEmpty($ctrl->getCmd());
138 $this->createStub(ilCtrlStructureInterface::class),
139 $this->createStub(ilCtrlTokenRepositoryInterface::class),
140 $this->createStub(ilCtrlPathFactoryInterface::class),
141 $this->createStub(ilCtrlContextInterface::class),
142 $this->createStub(ResponseSenderStrategy::class),
143 $this->createStub(ServerRequestInterface::class),
144 $this->createStub(RequestWrapper::class),
145 $this->createStub(RequestWrapper::class),
146 $this->createStub(Refinery::class),
147 $this->createStub(ilComponentFactory::class),
149 $this->createStub(ilCtrlQueryParserInterface::class),
150 $this->createStub(MessageFactory::class),
153 $fallback_cmd =
'fallback_cmd_test';
157 $ctrl->getCmd($fallback_cmd)
229 $this->createStub(ilCtrlStructureInterface::class),
230 $this->createStub(ilCtrlTokenRepositoryInterface::class),
231 $this->createStub(ilCtrlPathFactoryInterface::class),
232 $this->createStub(ilCtrlContextInterface::class),
233 $this->createStub(ResponseSenderStrategy::class),
234 $this->createStub(ServerRequestInterface::class),
235 $this->createStub(RequestWrapper::class),
236 $this->createStub(RequestWrapper::class),
237 $this->createStub(Refinery::class),
238 $this->createStub(ilComponentFactory::class),
240 $this->createStub(ilCtrlQueryParserInterface::class),
241 $this->createStub(MessageFactory::class),
$structure
TOTAL STRUCTURE.
Class ilCtrlCommandClass1TestGUI.
Class ilCtrlCommandClass2TestGUI.
Class ilCtrlInvalidGuiClass.
testCallBaseClassWithoutBaseClass()
testGetHtmlWithInvalidObject()
testGetHtmlWithValidObjectAndParameters()
testGetCmdWithoutProvidedCmdAndFallback()
testCallBaseClassWithInvalidProvidedBaseClass()
testForwardCommandWithValidObject()
testGetHtmlWithValidObject()
testGetCmdWithoutProvidedCmd()
testForwardCommandWithInvalidObject()
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
Class ilCtrl provides processing control methods.
Creates psr-7 messages without binding components to the underlying library.
Interface ResponseSenderStrategy.
Interface RequestWrapper.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...