ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
OfComponentTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
27 class OfComponentTest extends TestCase
28 {
29  protected Component $component;
30  protected D\OfComponent $of_component;
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 
52  $of_component = new D\OfComponent(
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