19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
38 $this->reader =
new Reader(
45 #[\PHPUnit\Framework\Attributes\DataProvider('scenarios')]
48 require_once(__DIR__ .
"/scenarios/$scenario_file");
51 $resolved = $this->resolver->resolveDependencies([], ...
$components);
53 $result = $this->
renderer->render(...$resolved);
55 $expected = file_get_contents(__DIR__ .
"/scenarios/$result_file");
56 $this->assertEquals($expected, $result);
62 "no dependencies" => [
"scenario1.php",
"result1.php",
64 \ILIAS\Component\Tests\Dependencies\Scenario1\ComponentA::class
67 "pull dependency" => [
"scenario2.php",
"result2.php",
69 \ILIAS\Component\Tests\Dependencies\Scenario2\ComponentA::class,
70 \ILIAS\Component\Tests\Dependencies\Scenario2\ComponentB::class
73 "use dependency" => [
"scenario3.php",
"result3.php",
75 \ILIAS\Component\Tests\Dependencies\Scenario3\ComponentA::class,
76 \ILIAS\Component\Tests\Dependencies\Scenario3\ComponentB::class
79 "seek dependency" => [
"scenario4.php",
"result4.php",
81 \ILIAS\Component\Tests\Dependencies\Scenario4\ComponentA::class,
82 \ILIAS\Component\Tests\Dependencies\Scenario4\ComponentB::class,
83 \ILIAS\Component\Tests\Dependencies\Scenario4\ComponentC::class
86 "render entry points" => [
"scenario5.php",
"result5.php",
88 \ILIAS\Component\Tests\Dependencies\Scenario5\ComponentA::class
This takes a (hopefully resolved...) dependency tree and renders it in PHP to be used for initialisat...
testScenario($scenario_file, $result_file, $components)