ILIAS  release_8 Revision v8.23
ilCtrlPathTestBase.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /* Copyright (c) 2021 Thibeau Fuhrer <thf@studer-raimann.ch> Extended GPL, see docs/LICENSE */
6 
8 
13 class ilCtrlPathTestBase extends TestCase
14 {
19 
23  protected function setUp(): void
24  {
25  $structure_artifact = require __DIR__ . '/../Data/Structure/test_ctrl_structure.php';
26  $base_class_artifact = require __DIR__ . '/../Data/Structure/test_base_classes.php';
27 
28  $this->structure = new ilCtrlStructure(
29  $structure_artifact,
30  $base_class_artifact,
31  []
32  );
33  }
34 
39  protected function getPath(string $cid_path = null): ilCtrlPathInterface
40  {
41  return new class ($this->structure, $cid_path) extends ilCtrlAbstractPath {
42  public function __construct(ilCtrlStructureInterface $structure, string $cid_path = null)
43  {
44  parent::__construct($structure);
45  $this->cid_path = $cid_path;
46  }
47  };
48  }
49 }
Class ilCtrlStructure holds the currently read control structure.
Class ilCtrlAbstractPath.
Class ilCtrlPathTestBase.
__construct(Container $dic, ilPlugin $plugin)
ilCtrlStructureInterface $structure
getPath(string $cid_path=null)
Interface ilCtrlPathInterface is responsible for holding and manipulating a valid ilCtrl class-path (...