Class ilCtrlTest.
More...
◆ getMockedCtrl()
ilCtrlTest::getMockedCtrl |
( |
| ) |
|
|
private |
Helper function that returns an ilCtrl instance with mocked dependencies.
- Returns
- ilCtrlInterface
Definition at line 223 of file ilCtrlTest.php.
Referenced by testCallBaseClassWithoutBaseClass(), testForwardCommandWithInvalidObject(), testForwardCommandWithValidObject(), testGetCmdWithoutProvidedCmd(), testGetHtmlWithInvalidObject(), testGetHtmlWithValidObject(), and testGetHtmlWithValidObjectAndParameters().
226 $this->createMock(ilCtrlStructureInterface::class),
227 $this->createMock(ilCtrlTokenRepositoryInterface::class),
228 $this->createMock(ilCtrlPathFactoryInterface::class),
229 $this->createMock(ilCtrlContextInterface::class),
230 $this->createMock(ResponseSenderStrategy::class),
231 $this->createMock(ServerRequestInterface::class),
232 $this->createMock(RequestWrapper::class),
233 $this->createMock(RequestWrapper::class),
234 $this->createMock(Refinery::class),
235 $this->createMock(ilComponentFactory::class),
237 $this->createMock(ilCtrlQueryParserInterface::class),
◆ testCallBaseClassWithInvalidProvidedBaseClass()
ilCtrlTest::testCallBaseClassWithInvalidProvidedBaseClass |
( |
| ) |
|
Definition at line 43 of file ilCtrlTest.php.
References $structure.
45 $structure = $this->createMock(ilCtrlStructureInterface::class);
47 ->method(
'isBaseClass')
53 $this->createMock(ilCtrlTokenRepositoryInterface::class),
54 $this->createMock(ilCtrlPathFactoryInterface::class),
55 $this->createMock(ilCtrlContextInterface::class),
56 $this->createMock(ResponseSenderStrategy::class),
57 $this->createMock(ServerRequestInterface::class),
58 $this->createMock(RequestWrapper::class),
59 $this->createMock(RequestWrapper::class),
60 $this->createMock(Refinery::class),
61 $this->createMock(ilComponentFactory::class),
63 $this->createMock(ilCtrlQueryParserInterface::class),
66 $invalid_baseclass = ilCtrlInvalidGuiClass::class;
68 $this->expectException(ilCtrlException::class);
69 $this->expectExceptionMessage(
"Provided class '$invalid_baseclass' is not a baseclass");
70 $ctrl->callBaseClass($invalid_baseclass);
$structure
TOTAL STRUCTURE.
◆ testCallBaseClassWithoutBaseClass()
ilCtrlTest::testCallBaseClassWithoutBaseClass |
( |
| ) |
|
Definition at line 34 of file ilCtrlTest.php.
References getMockedCtrl().
38 $this->expectException(ilCtrlException::class);
39 $this->expectExceptionMessage(ilCtrl::class .
"::callBaseClass was not given a baseclass and the request doesn't include one either.");
40 $ctrl->callBaseClass();
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
◆ testForwardCommandWithInvalidObject()
ilCtrlTest::testForwardCommandWithInvalidObject |
( |
| ) |
|
Definition at line 73 of file ilCtrlTest.php.
References getMockedCtrl().
77 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
79 $this->expectException(ilCtrlException::class);
80 $this->expectExceptionMessage(ilCtrlInvalidGuiClass::class .
" doesn't implement executeCommand().");
Class ilCtrlInvalidGuiClass.
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
◆ testForwardCommandWithValidObject()
ilCtrlTest::testForwardCommandWithValidObject |
( |
| ) |
|
Definition at line 84 of file ilCtrlTest.php.
References getMockedCtrl().
88 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass1TestGUI.php';
91 ilCtrlCommandClass1TestGUI::class,
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
Class ilCtrlCommandClass1TestGUI.
◆ testGetCmdWithoutProvidedCmd()
ilCtrlTest::testGetCmdWithoutProvidedCmd |
( |
| ) |
|
Definition at line 125 of file ilCtrlTest.php.
References getMockedCtrl().
130 $this->assertEmpty($ctrl->getCmd());
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
◆ testGetCmdWithoutProvidedCmdAndFallback()
ilCtrlTest::testGetCmdWithoutProvidedCmdAndFallback |
( |
| ) |
|
Definition at line 133 of file ilCtrlTest.php.
136 $this->createMock(ilCtrlStructureInterface::class),
137 $this->createMock(ilCtrlTokenRepositoryInterface::class),
138 $this->createMock(ilCtrlPathFactoryInterface::class),
139 $this->createMock(ilCtrlContextInterface::class),
140 $this->createMock(ResponseSenderStrategy::class),
141 $this->createMock(ServerRequestInterface::class),
142 $this->createMock(RequestWrapper::class),
143 $this->createMock(RequestWrapper::class),
144 $this->createMock(Refinery::class),
145 $this->createMock(ilComponentFactory::class),
147 $this->createMock(ilCtrlQueryParserInterface::class),
150 $fallback_cmd =
'fallback_cmd_test';
154 $ctrl->getCmd($fallback_cmd)
◆ testGetHtmlWithInvalidObject()
ilCtrlTest::testGetHtmlWithInvalidObject |
( |
| ) |
|
Definition at line 96 of file ilCtrlTest.php.
References getMockedCtrl().
100 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
102 $this->expectException(ilCtrlException::class);
103 $this->expectExceptionMessage(ilCtrlInvalidGuiClass::class .
" doesn't implement getHTML().");
Class ilCtrlInvalidGuiClass.
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
◆ testGetHtmlWithValidObject()
ilCtrlTest::testGetHtmlWithValidObject |
( |
| ) |
|
Definition at line 107 of file ilCtrlTest.php.
References getMockedCtrl().
111 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass2TestGUI.php';
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
Class ilCtrlCommandClass2TestGUI.
◆ testGetHtmlWithValidObjectAndParameters()
ilCtrlTest::testGetHtmlWithValidObjectAndParameters |
( |
| ) |
|
Definition at line 116 of file ilCtrlTest.php.
References getMockedCtrl().
120 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass2TestGUI.php';
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
Class ilCtrlCommandClass2TestGUI.
The documentation for this class was generated from the following file: