ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\Component\Tests\Dependencies\RendererTest Class Reference
+ Inheritance diagram for ILIAS\Component\Tests\Dependencies\RendererTest:
+ Collaboration diagram for ILIAS\Component\Tests\Dependencies\RendererTest:

Public Member Functions

 setUp ()
 
 testScenario ($scenario_file, $result_file, $components)
 

Static Public Member Functions

static scenarios ()
 

Protected Attributes

Reader $reader
 
Resolver $resolver
 
Renderer $renderer
 

Detailed Description

Definition at line 29 of file RendererTest.php.

Member Function Documentation

◆ scenarios()

static ILIAS\Component\Tests\Dependencies\RendererTest::scenarios ( )
static

Definition at line 56 of file RendererTest.php.

57  {
58  return [
59  "no dependencies" => ["scenario1.php", "result1.php",
60  [
61  \ILIAS\Component\Tests\Dependencies\Scenario1\ComponentA::class
62  ]
63  ],
64  "pull dependency" => ["scenario2.php", "result2.php",
65  [
66  \ILIAS\Component\Tests\Dependencies\Scenario2\ComponentA::class,
67  \ILIAS\Component\Tests\Dependencies\Scenario2\ComponentB::class
68  ]
69  ],
70  "use dependency" => ["scenario3.php", "result3.php",
71  [
72  \ILIAS\Component\Tests\Dependencies\Scenario3\ComponentA::class,
73  \ILIAS\Component\Tests\Dependencies\Scenario3\ComponentB::class
74  ]
75  ],
76  "seek dependency" => ["scenario4.php", "result4.php",
77  [
78  \ILIAS\Component\Tests\Dependencies\Scenario4\ComponentA::class,
79  \ILIAS\Component\Tests\Dependencies\Scenario4\ComponentB::class,
80  \ILIAS\Component\Tests\Dependencies\Scenario4\ComponentC::class
81  ]
82  ],
83  "render entry points" => ["scenario5.php", "result5.php",
84  [
85  \ILIAS\Component\Tests\Dependencies\Scenario5\ComponentA::class
86  ]
87  ]
88  ];
89  }

◆ setUp()

ILIAS\Component\Tests\Dependencies\RendererTest::setUp ( )

Definition at line 35 of file RendererTest.php.

References renderer().

35  : void
36  {
37  $this->reader = new Reader();
38  $this->resolver = new Resolver();
39  $this->renderer = new Renderer();
40  }
renderer()
+ Here is the call graph for this function:

◆ testScenario()

ILIAS\Component\Tests\Dependencies\RendererTest::testScenario (   $scenario_file,
  $result_file,
  $components 
)

Definition at line 43 of file RendererTest.php.

References $c, $components, and renderer().

44  {
45  require_once(__DIR__ . "/scenarios/$scenario_file");
46 
47  $components = array_map(fn($c) => $this->reader->read(new $c()), $components);
48  $resolved = $this->resolver->resolveDependencies([], ...$components);
49 
50  $result = $this->renderer->render(...$resolved);
51 
52  $expected = file_get_contents(__DIR__ . "/scenarios/$result_file");
53  $this->assertEquals($expected, $result);
54  }
renderer()
$c
Definition: deliver.php:25
$components
+ Here is the call graph for this function:

Field Documentation

◆ $reader

Reader ILIAS\Component\Tests\Dependencies\RendererTest::$reader
protected

Definition at line 31 of file RendererTest.php.

◆ $renderer

Renderer ILIAS\Component\Tests\Dependencies\RendererTest::$renderer
protected

Definition at line 33 of file RendererTest.php.

◆ $resolver

Resolver ILIAS\Component\Tests\Dependencies\RendererTest::$resolver
protected

Definition at line 32 of file RendererTest.php.


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