ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilModulesOrgUnitTypeTest Class Reference
+ Inheritance diagram for ilModulesOrgUnitTypeTest:
+ Collaboration diagram for ilModulesOrgUnitTypeTest:

Public Member Functions

 getRefinery ()
 
 getUIFactory ()
 
 testOrgUnitTypeGuiAMDForm ()
 

Detailed Description

Definition at line 42 of file ilModulesOrgUnitTypeTest.php.

Member Function Documentation

◆ getRefinery()

ilModulesOrgUnitTypeTest::getRefinery ( )

Definition at line 44 of file ilModulesOrgUnitTypeTest.php.

45 {
46 $data_factory = new \ILIAS\Data\Factory();
47 $refinery = new \ILIAS\Refinery\Factory($data_factory, $this->createStub(ilLanguage::class));
48 return $refinery;
49 }
Builds data types.
Definition: Factory.php:36

References ILIAS\UI\examples\Layout\Page\Mail\$refinery.

Referenced by getUIFactory(), and testOrgUnitTypeGuiAMDForm().

+ Here is the caller graph for this function:

◆ getUIFactory()

ilModulesOrgUnitTypeTest::getUIFactory ( )

Definition at line 51 of file ilModulesOrgUnitTypeTest.php.

52 {
53 $refinery = $this->getRefinery();
54
55 $factory = new class (
56 $this->createStub(\ILIAS\UI\Implementation\Component\Input\Field\Node\Factory::class),
57 $this->createStub(ilLanguage::class),
58 $this->createStub(Component\Input\Container\Filter\Factory::class),
59 $this->createStub(Component\Input\Container\ViewControl\Factory::class),
60 $this->createStub(Component\Input\ViewControl\Factory::class),
61 $this->createStub(Component\Input\UploadLimitResolver::class),
63 ) extends NoUIFactory {
64 public function __construct(
65 protected $node_factory,
66 protected $language,
67 protected $filter_factory,
68 protected $view_control_factory,
69 protected $control_factory,
70 protected $upload_limit_resolver,
71 protected $refinery
72 ) {
73 }
74
75 public function input(): Component\Input\Factory
76 {
77 $signal_generator = new Component\SignalGenerator();
78 $data_factory = new \ILIAS\Data\Factory();
79
80 $field_factory = new Component\Input\Field\Factory(
81 $this->node_factory,
82 $this->upload_limit_resolver,
83 $signal_generator,
84 $data_factory,
85 $this->refinery,
86 $this->language
87 );
88
89 $form_factory = new Component\Input\Container\Form\Factory(
90 $field_factory,
91 $signal_generator
92 );
93 $container_factory = new Component\Input\Container\Factory(
94 $form_factory,
95 $this->filter_factory,
96 $this->view_control_factory
97 );
98
99 return new Component\Input\Factory(
100 $signal_generator,
101 $field_factory,
102 $container_factory,
103 $this->control_factory,
104 );
105 }
106 };
107 return $factory;
108 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References ILIAS\UI\examples\Layout\Page\Mail\$refinery, ILIAS\GlobalScreen\Provider\__construct(), getRefinery(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\refinery().

Referenced by testOrgUnitTypeGuiAMDForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testOrgUnitTypeGuiAMDForm()

ilModulesOrgUnitTypeTest::testOrgUnitTypeGuiAMDForm ( )

Definition at line 110 of file ilModulesOrgUnitTypeTest.php.

110 : void
111 {
112 $amdr1 = $this->createMock(ilAdvancedMDRecord::class);
113 $amdr1
114 ->method('getRecordId')
115 ->willReturn(1);
116 $amdr1
117 ->method('getTitle')
118 ->willReturn('title 1');
119
120 $amdr2 = $this->createMock(ilAdvancedMDRecord::class);
121 $amdr2
122 ->method('getRecordId')
123 ->willReturn(2);
124 $amdr2
125 ->method('getTitle')
126 ->willReturn('title 2');
127
128 $type = $this->createMock(ilOrgUnitType::class);
129 $type
130 ->method('getAssignedAdvancedMDRecordIds')
131 ->willReturn([1]);
132
133 $gui = new mock_ilOrgUnitTypeGUI(
134 $this->getRefinery(),
135 $this->getUIFactory(),
136 $this->createStub(ilLanguage::class)
137 );
138
139 $form = $gui->mockGetAmdForm([$amdr1, $amdr2], $type);
140 $this->assertInstanceOf(StandardForm::class, $form);
141
142 $section = current($form->getInputs());
143 $this->assertInstanceOf(Section::class, $section);
144
145 $inputs = $section->getInputs();
146 $this->assertEquals(1, count($inputs));
147 $this->assertEquals(
148 [
149 1 => 'title 1',
150 2 => 'title 2',
151 ],
152 current($inputs)->getOptions()
153 );
154 }

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\UI\Implementation\Component\Input\Field\getOptions(), getRefinery(), and getUIFactory().

+ Here is the call graph for this function:

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