ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 $language = $this->createMock(ilLanguage::class);
48 $refinery = new \ILIAS\Refinery\Factory($data_factory, $language);
49 return $refinery;
50 }
Builds data types.
Definition: Factory.php:36

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

Referenced by getUIFactory(), and testOrgUnitTypeGuiAMDForm().

+ Here is the caller graph for this function:

◆ getUIFactory()

ilModulesOrgUnitTypeTest::getUIFactory ( )

Definition at line 52 of file ilModulesOrgUnitTypeTest.php.

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

References ILIAS\UI\examples\Layout\Page\Standard\$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 117 of file ilModulesOrgUnitTypeTest.php.

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

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

+ Here is the call graph for this function:

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