Class ilCtrlArrayClassPathTest.
More...
◆ testArrayPathWithContextAndProvidedBaseClass()
ilCtrlArrayClassPathTest::testArrayPathWithContextAndProvidedBaseClass |
( |
| ) |
|
Definition at line 135 of file ilCtrlArrayClassPathTest.php.
References $context, $path, and ilCtrlPathTestBase\getPath().
139 $context = $this->createMock(ilCtrlContextInterface::class);
142 ->willReturn($this->
getPath(
'0:2'));
144 $new_base_class = ilCtrlBaseClass2TestGUI::class;
145 $first_target_class = ilCtrlCommandClass1TestGUI::class;
146 $second_target_class = ilCtrlCommandClass2TestGUI::class;
150 [$new_base_class, $first_target_class, $second_target_class]
153 $this->assertEquals(
'1:2:3',
$path->getCidPath());
Class ilCtrlArrayClassPath.
getPath(?string $cid_path=null)
◆ testArrayPathWithContextBaseClass()
ilCtrlArrayClassPathTest::testArrayPathWithContextBaseClass |
( |
| ) |
|
Definition at line 116 of file ilCtrlArrayClassPathTest.php.
References $context, $path, and ilCtrlPathTestBase\getPath().
119 $context = $this->createMock(ilCtrlContextInterface::class);
122 ->willReturn($this->
getPath(
'1:4'));
124 $first_target_class = ilCtrlCommandClass1TestGUI::class;
125 $second_target_class = ilCtrlCommandClass2TestGUI::class;
129 [$first_target_class, $second_target_class]
132 $this->assertEquals(
'1:2:3',
$path->getCidPath());
Class ilCtrlArrayClassPath.
getPath(?string $cid_path=null)
◆ testArrayPathWithEmptyTargets()
ilCtrlArrayClassPathTest::testArrayPathWithEmptyTargets |
( |
| ) |
|
Definition at line 29 of file ilCtrlArrayClassPathTest.php.
References $path.
33 $this->createMock(ilCtrlContextInterface::class),
37 $this->assertNotNull(
$path->getException());
38 $this->expectException(ilCtrlException::class);
39 $this->expectExceptionMessage(ilCtrlArrayClassPath::class .
'::getCidPathByArray must be provided with a list of classes.');
40 throw $path->getException();
Class ilCtrlArrayClassPath.
◆ testArrayPathWithoutBaseClass()
ilCtrlArrayClassPathTest::testArrayPathWithoutBaseClass |
( |
| ) |
|
Definition at line 74 of file ilCtrlArrayClassPathTest.php.
References $context, $path, ilCtrlPathTestBase\getPath(), and null.
77 $context = $this->createMock(ilCtrlContextInterface::class);
82 $first_target_class = ilCtrlCommandClass1TestGUI::class;
83 $second_target_class = ilCtrlCommandClass2TestGUI::class;
87 [$first_target_class, $second_target_class]
90 $this->assertNotNull(
$path->getException());
91 $this->expectException(ilCtrlException::class);
92 $this->expectExceptionMessage(
"Class '$first_target_class' is not a baseclass and the current context doesn't have one either.");
93 throw $path->getException();
Class ilCtrlArrayClassPath.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPath(?string $cid_path=null)
◆ testArrayPathWithProvidedBaseClass()
ilCtrlArrayClassPathTest::testArrayPathWithProvidedBaseClass |
( |
| ) |
|
Definition at line 96 of file ilCtrlArrayClassPathTest.php.
References $context, $path, ilCtrlPathTestBase\getPath(), and null.
99 $context = $this->createMock(ilCtrlContextInterface::class);
104 $base_class = ilCtrlBaseClass2TestGUI::class;
105 $first_target_class = ilCtrlCommandClass1TestGUI::class;
106 $second_target_class = ilCtrlCommandClass2TestGUI::class;
110 [$base_class, $first_target_class, $second_target_class]
113 $this->assertEquals(
'1:2:3',
$path->getCidPath());
Class ilCtrlArrayClassPath.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getPath(?string $cid_path=null)
◆ testArrayPathWithUnknownTargetClass()
ilCtrlArrayClassPathTest::testArrayPathWithUnknownTargetClass |
( |
| ) |
|
Definition at line 43 of file ilCtrlArrayClassPathTest.php.
References $path.
45 $invalid_class = ilCtrlInvalidGuiClass::class;
48 $this->createMock(ilCtrlContextInterface::class),
52 $this->assertNotNull(
$path->getException());
53 $this->expectException(ilCtrlException::class);
54 $this->expectExceptionMessage(
"Class '$invalid_class' was not found in the control structure, try `composer du` to read artifacts.");
55 throw $path->getException();
Class ilCtrlArrayClassPath.
◆ testArrayPathWithUnrelatedTargets()
ilCtrlArrayClassPathTest::testArrayPathWithUnrelatedTargets |
( |
| ) |
|
Definition at line 58 of file ilCtrlArrayClassPathTest.php.
References $path.
60 $parent_class = ilCtrlBaseClass2TestGUI::class;
61 $child_class = ilCtrlCommandClass2TestGUI::class;
64 $this->createMock(ilCtrlContextInterface::class),
65 [$parent_class, $child_class]
68 $this->assertNotNull(
$path->getException());
69 $this->expectException(ilCtrlException::class);
70 $this->expectExceptionMessage(
"Class '$child_class' is not a child of '$parent_class'.");
71 throw $path->getException();
Class ilCtrlArrayClassPath.
The documentation for this class was generated from the following file: