3 declare(strict_types=1);
     7 require_once __DIR__ . 
'/ilCtrlPathTestBase.php';
    19             $this->createMock(ilCtrlContextInterface::class),
    23         $this->assertNotNull(
$path->getException());
    24         $this->expectException(ilCtrlException::class);
    25         $this->expectExceptionMessage(ilCtrlArrayClassPath::class . 
'::getCidPathByArray must be provided with a list of classes.');
    26         throw $path->getException();
    31         $invalid_class = ilCtrlInvalidGuiClass::class;
    34             $this->createMock(ilCtrlContextInterface::class),
    38         $this->assertNotNull(
$path->getException());
    39         $this->expectException(ilCtrlException::class);
    40         $this->expectExceptionMessage(
"Class '$invalid_class' was not found in the control structure, try `composer du` to read artifacts.");
    41         throw $path->getException();
    46         $parent_class = ilCtrlBaseClass2TestGUI::class;
    47         $child_class = ilCtrlCommandClass2TestGUI::class;
    50             $this->createMock(ilCtrlContextInterface::class),
    51             [$parent_class, $child_class]
    54         $this->assertNotNull(
$path->getException());
    55         $this->expectException(ilCtrlException::class);
    56         $this->expectExceptionMessage(
"Class '$child_class' is not a child of '$parent_class'.");
    57         throw $path->getException();
    63         $context = $this->createMock(ilCtrlContextInterface::class);
    66             ->willReturn($this->
getPath(null));
    68         $first_target_class = ilCtrlCommandClass1TestGUI::class;
    69         $second_target_class = ilCtrlCommandClass2TestGUI::class;
    73             [$first_target_class, $second_target_class]
    76         $this->assertNotNull(
$path->getException());
    77         $this->expectException(ilCtrlException::class);
    78         $this->expectExceptionMessage(
"Class '$first_target_class' is not a baseclass and the current context doesn't have one either.");
    79         throw $path->getException();
    85         $context = $this->createMock(ilCtrlContextInterface::class);
    88             ->willReturn($this->
getPath(null));
    90         $base_class = ilCtrlBaseClass2TestGUI::class;
    91         $first_target_class = ilCtrlCommandClass1TestGUI::class;
    92         $second_target_class = ilCtrlCommandClass2TestGUI::class;
    96             [$base_class, $first_target_class, $second_target_class]
    99         $this->assertEquals(
'1:2:3', 
$path->getCidPath());
   105         $context = $this->createMock(ilCtrlContextInterface::class);
   108             ->willReturn($this->
getPath(
'1:4'));
   110         $first_target_class = ilCtrlCommandClass1TestGUI::class;
   111         $second_target_class = ilCtrlCommandClass2TestGUI::class;
   115             [$first_target_class, $second_target_class]
   118         $this->assertEquals(
'1:2:3', 
$path->getCidPath());
   125         $context = $this->createMock(ilCtrlContextInterface::class);
   128             ->willReturn($this->
getPath(
'0:2'));
   130         $new_base_class = ilCtrlBaseClass2TestGUI::class;
   131         $first_target_class = ilCtrlCommandClass1TestGUI::class;
   132         $second_target_class = ilCtrlCommandClass2TestGUI::class;
   136             [$new_base_class, $first_target_class, $second_target_class]
   139         $this->assertEquals(
'1:2:3', 
$path->getCidPath());
 
Class ilCtrlArrayClassPathTest. 
 
testArrayPathWithUnknownTargetClass()
 
testArrayPathWithEmptyTargets()
 
testArrayPathWithContextAndProvidedBaseClass()
 
Class ilCtrlArrayClassPath. 
 
testArrayPathWithContextBaseClass()
 
Class ilCtrlPathTestBase. 
 
testArrayPathWithUnrelatedTargets()
 
testArrayPathWithoutBaseClass()
 
testArrayPathWithProvidedBaseClass()
 
getPath(string $cid_path=null)