ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCtrlPathFactoryTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once __DIR__ . '/ilCtrlPathTestBase.php';
22
29{
34
38 protected function setUp(): void
39 {
40 parent::setUp();
41
42 $this->factory = new ilCtrlPathFactory($this->structure);
43 }
44
46 {
47 $context = $this->createMock(ilCtrlContextInterface::class);
48 $path = $this->factory->find($context, ilCtrlBaseClass1TestGUI::class);
49
50 $this->assertEquals('0', $path->getCidPath());
51 $this->assertInstanceOf(
52 ilCtrlSingleClassPath::class,
53 $path
54 );
55 }
56
58 {
59 $context = $this->createMock(ilCtrlContextInterface::class);
60 $path = $this->factory->find($context, [
61 ilCtrlBaseClass1TestGUI::class,
62 ilCtrlCommandClass1TestGUI::class,
63 ]);
64
65 $this->assertEquals('0:2', $path->getCidPath());
66 $this->assertInstanceOf(
67 ilCtrlArrayClassPath::class,
68 $path
69 );
70 }
71
72 public function testPathFactoryNullPath(): void
73 {
74 $path = $this->factory->null();
75
76 $this->assertNull($path->getCidPath());
77 $this->assertInstanceOf(
78 ilCtrlNullPath::class,
79 $path
80 );
81 }
82
83 public function testPathFactoryExistingPath(): void
84 {
85 $path = $this->factory->existing('foo');
86
87 $this->assertEquals('foo', $path->getCidPath());
88 $this->assertInstanceOf(
89 ilCtrlExistingPath::class,
90 $path
91 );
92 }
93}
factory()
Class ilCtrlPathFactoryTest.
Class ilCtrlPathFactory.
Class ilCtrlPathTestBase.
$path
Definition: ltiservices.php:30
$context
Definition: webdav.php:31