Class ilCtrlTest.
More...
◆ getMockedCtrl()
ilCtrlTest::getMockedCtrl |
( |
| ) |
|
|
private |
Helper function that returns an ilCtrl instance with mocked dependencies.
- Returns
- ilCtrlInterface
Definition at line 207 of file ilCtrlTest.php.
Referenced by testCallBaseClassWithoutBaseClass(), testForwardCommandWithInvalidObject(), testForwardCommandWithValidObject(), testGetCmdWithoutProvidedCmd(), testGetHtmlWithInvalidObject(), testGetHtmlWithValidObject(), and testGetHtmlWithValidObjectAndParameters().
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)
◆ testCallBaseClassWithInvalidProvidedBaseClass()
ilCtrlTest::testCallBaseClassWithInvalidProvidedBaseClass |
( |
| ) |
|
Definition at line 29 of file ilCtrlTest.php.
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);
◆ testCallBaseClassWithoutBaseClass()
ilCtrlTest::testCallBaseClassWithoutBaseClass |
( |
| ) |
|
Definition at line 20 of file ilCtrlTest.php.
References getMockedCtrl().
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();
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
◆ testForwardCommandWithInvalidObject()
ilCtrlTest::testForwardCommandWithInvalidObject |
( |
| ) |
|
Definition at line 58 of file ilCtrlTest.php.
References getMockedCtrl().
62 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
64 $this->expectException(ilCtrlException::class);
65 $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 69 of file ilCtrlTest.php.
References getMockedCtrl().
73 require_once __DIR__ .
'/Data/GUI/class.ilCtrlCommandClass1TestGUI.php';
76 ilCtrlCommandClass1TestGUI::class,
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...
◆ testGetCmdWithoutProvidedCmd()
ilCtrlTest::testGetCmdWithoutProvidedCmd |
( |
| ) |
|
Definition at line 110 of file ilCtrlTest.php.
References getMockedCtrl().
115 $this->assertEmpty($ctrl->getCmd());
getMockedCtrl()
Helper function that returns an ilCtrl instance with mocked dependencies.
◆ testGetCmdWithoutProvidedCmdAndFallback()
ilCtrlTest::testGetCmdWithoutProvidedCmdAndFallback |
( |
| ) |
|
Definition at line 118 of file ilCtrlTest.php.
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)
◆ testGetHtmlWithInvalidObject()
ilCtrlTest::testGetHtmlWithInvalidObject |
( |
| ) |
|
Definition at line 81 of file ilCtrlTest.php.
References getMockedCtrl().
85 require_once __DIR__ .
'/Data/GUI/class.ilCtrlInvalidGuiClass.php';
87 $this->expectException(ilCtrlException::class);
88 $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 92 of file ilCtrlTest.php.
References getMockedCtrl().
96 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 101 of file ilCtrlTest.php.
References getMockedCtrl().
105 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: