Class ilCtrlSingleClassPathTest.
More...
◆ testSinglePathBaseclassPriority()
| ilCtrlSingleClassPathTest::testSinglePathBaseclassPriority |
( |
| ) |
|
Definition at line 136 of file ilCtrlSingleClassPathTest.php.
136 : void
137 {
138
139 $context = $this->createMock(ilCtrlContextInterface::class);
140 $context
141 ->method('getPath')
142 ->willReturn($this->
getPath(
'0.2'))
143 ;
144
146 $this->structure,
147 $context,
148 ilCtrlBaseClass2TestGUI::class
149 );
150
151
152
153
154 $this->assertEquals(
'0.2.1',
$path->getCidPath());
155 }
getPath(?string $cid_path=null)
Class ilCtrlSingleClassPath.
References $path, and ilCtrlPathTestBase\getPath().
◆ testSinglePathWithContextBaseClass()
| ilCtrlSingleClassPathTest::testSinglePathWithContextBaseClass |
( |
| ) |
|
Definition at line 67 of file ilCtrlSingleClassPathTest.php.
67 : void
68 {
69
70 $context = $this->createMock(ilCtrlContextInterface::class);
71 $context
72 ->method('getPath')
73 ->willReturn($this->
getPath(
'0.4'))
74 ;
75
77 $this->structure,
78 $context,
79 ilCtrlCommandClass1TestGUI::class
80 );
81
82 $this->assertEquals(
'0.2',
$path->getCidPath());
83 }
References $path, and ilCtrlPathTestBase\getPath().
◆ testSinglePathWithEmptyTargetClassString()
| ilCtrlSingleClassPathTest::testSinglePathWithEmptyTargetClassString |
( |
| ) |
|
Definition at line 122 of file ilCtrlSingleClassPathTest.php.
122 : void
123 {
125 $this->structure,
126 $this->createMock(ilCtrlContextInterface::class),
127 ''
128 );
129
130 $this->assertNotNull(
$path->getException());
131 $this->expectException(ilCtrlException::class);
132 $this->expectExceptionMessage("Class '' was not found in the control structure, try `composer du` to read artifacts.");
133 throw $path->getException();
134 }
References $path.
◆ testSinglePathWithoutBaseClass()
| ilCtrlSingleClassPathTest::testSinglePathWithoutBaseClass |
( |
| ) |
|
Definition at line 45 of file ilCtrlSingleClassPathTest.php.
45 : void
46 {
47
48 $context = $this->createMock(ilCtrlContextInterface::class);
49 $context
50 ->method('getPath')
51 ->willReturn($this->
getPath(
null))
52 ;
53
54 $target_class = ilCtrlCommandClass1TestGUI::class;
56 $this->structure,
57 $context,
58 $target_class
59 );
60
61 $this->assertNotNull(
$path->getException());
62 $this->expectException(ilCtrlException::class);
63 $this->expectExceptionMessage("ilCtrl cannot find a path for '$target_class' that reaches ''");
64 throw $path->getException();
65 }
References $path, and ilCtrlPathTestBase\getPath().
◆ testSinglePathWithProvidedBaseClass()
| ilCtrlSingleClassPathTest::testSinglePathWithProvidedBaseClass |
( |
| ) |
|
Definition at line 85 of file ilCtrlSingleClassPathTest.php.
85 : void
86 {
87
88 $context = $this->createMock(ilCtrlContextInterface::class);
89 $context
90 ->method('getPath')
91 ->willReturn($this->
getPath(
null))
92 ;
93
95 $this->structure,
96 $context,
97 ilCtrlBaseClass1TestGUI::class
98 );
99
100 $this->assertEquals(
'0',
$path->getCidPath());
101 }
References $path, and ilCtrlPathTestBase\getPath().
◆ testSinglePathWithSameTargetClass()
| ilCtrlSingleClassPathTest::testSinglePathWithSameTargetClass |
( |
| ) |
|
Definition at line 103 of file ilCtrlSingleClassPathTest.php.
103 : void
104 {
105
106
107 $context = $this->createMock(ilCtrlContextInterface::class);
108 $context
109 ->method('getPath')
110 ->willReturn($this->
getPath(
'1.2.3'))
111 ;
112
114 $this->structure,
115 $context,
116 ilCtrlCommandClass2TestGUI::class
117 );
118
119 $this->assertEquals(
'1.2.3',
$path->getCidPath());
120 }
References $path, and ilCtrlPathTestBase\getPath().
◆ testSinglePathWithUnknownClass()
| ilCtrlSingleClassPathTest::testSinglePathWithUnknownClass |
( |
| ) |
|
Definition at line 30 of file ilCtrlSingleClassPathTest.php.
30 : void
31 {
32 $invalid_class = ilCtrlInvalidGuiClass::class;
34 $this->structure,
35 $this->createMock(ilCtrlContextInterface::class),
36 $invalid_class
37 );
38
39 $this->assertNotNull(
$path->getException());
40 $this->expectException(ilCtrlException::class);
41 $this->expectExceptionMessage("Class '$invalid_class' was not found in the control structure, try `composer du` to read artifacts.");
42 throw $path->getException();
43 }
References $path.
The documentation for this class was generated from the following file: