ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
OfComponentTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
26
27class OfComponentTest extends TestCase
28{
31
32 public function setUp(): void
33 {
34 $this->component = $this->createMock(Component::class);
35 $this->of_component = new D\OfComponent(
36 $this->component
37 );
38 }
39
40 public function testGetComponent(): void
41 {
42 $this->assertEquals($this->component, $this->of_component->getComponent());
43 }
44
45 public function testInDependencies(): void
46 {
47 $name = TestInterface::class;
48
49 $out = new D\Out(D\OutType::PROVIDE, $name, "Some\\Class", []);
50 $in = new D\In(D\InType::PULL, $name);
51
53 $this->component,
54 $in,
55 $out
56 );
57
58 $result = iterator_to_array($of_component->getInDependencies());
59
60 $this->assertEquals([$in], $result);
61 }
62}
$out
Definition: buildRTE.php:24
A dependency where the component needs something from the world.
Definition: In.php:27
A dependency where the component gives something to the world.
Definition: Out.php:27