ILIAS  release_8 Revision v8.23
ilCtrlPathFactoryTest Class Reference

Class ilCtrlPathFactoryTest. More...

+ Inheritance diagram for ilCtrlPathFactoryTest:
+ Collaboration diagram for ilCtrlPathFactoryTest:

Public Member Functions

 testPathFactoryFindSingleClassTargetPath ()
 
 testPathFactoryFindArrayClassTargetPath ()
 
 testPathFactoryNullPath ()
 
 testPathFactoryExistingPath ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ilCtrlPathTestBase
 setUp ()
 
 getPath (string $cid_path=null)
 

Private Attributes

ilCtrlPathFactory $factory
 

Additional Inherited Members

- Protected Attributes inherited from ilCtrlPathTestBase
ilCtrlStructureInterface $structure
 

Detailed Description

Member Function Documentation

◆ setUp()

ilCtrlPathFactoryTest::setUp ( )
protected

Definition at line 24 of file ilCtrlPathFactoryTest.php.

24  : void
25  {
26  parent::setUp();
27 
28  $this->factory = new ilCtrlPathFactory($this->structure);
29  }
Class ilCtrlPathFactory.

◆ testPathFactoryExistingPath()

ilCtrlPathFactoryTest::testPathFactoryExistingPath ( )

Definition at line 69 of file ilCtrlPathFactoryTest.php.

References $path.

69  : void
70  {
71  $path = $this->factory->existing('foo');
72 
73  $this->assertEquals('foo', $path->getCidPath());
74  $this->assertInstanceOf(
75  ilCtrlExistingPath::class,
76  $path
77  );
78  }
$path
Definition: ltiservices.php:32

◆ testPathFactoryFindArrayClassTargetPath()

ilCtrlPathFactoryTest::testPathFactoryFindArrayClassTargetPath ( )

Definition at line 43 of file ilCtrlPathFactoryTest.php.

References $context, and $path.

43  : void
44  {
45  $context = $this->createMock(ilCtrlContextInterface::class);
46  $path = $this->factory->find($context, [
47  ilCtrlBaseClass1TestGUI::class,
48  ilCtrlCommandClass1TestGUI::class,
49  ]);
50 
51  $this->assertEquals('0:2', $path->getCidPath());
52  $this->assertInstanceOf(
53  ilCtrlArrayClassPath::class,
54  $path
55  );
56  }
$context
Definition: webdav.php:29
$path
Definition: ltiservices.php:32

◆ testPathFactoryFindSingleClassTargetPath()

ilCtrlPathFactoryTest::testPathFactoryFindSingleClassTargetPath ( )

Definition at line 31 of file ilCtrlPathFactoryTest.php.

References $context, and $path.

31  : void
32  {
33  $context = $this->createMock(ilCtrlContextInterface::class);
34  $path = $this->factory->find($context, ilCtrlBaseClass1TestGUI::class);
35 
36  $this->assertEquals('0', $path->getCidPath());
37  $this->assertInstanceOf(
38  ilCtrlSingleClassPath::class,
39  $path
40  );
41  }
$context
Definition: webdav.php:29
$path
Definition: ltiservices.php:32

◆ testPathFactoryNullPath()

ilCtrlPathFactoryTest::testPathFactoryNullPath ( )

Definition at line 58 of file ilCtrlPathFactoryTest.php.

References $path.

58  : void
59  {
60  $path = $this->factory->null();
61 
62  $this->assertNull($path->getCidPath());
63  $this->assertInstanceOf(
64  ilCtrlNullPath::class,
65  $path
66  );
67  }
$path
Definition: ltiservices.php:32

Field Documentation

◆ $factory

ilCtrlPathFactory ilCtrlPathFactoryTest::$factory
private

Definition at line 19 of file ilCtrlPathFactoryTest.php.


The documentation for this class was generated from the following file: