ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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.

References ilOrgUnitTypeGUI\$refinery.

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:35
Refinery Factory $refinery

◆ getUIFactory()

ilModulesOrgUnitTypeTest::getUIFactory ( )

Definition at line 52 of file ilModulesOrgUnitTypeTest.php.

References ilOrgUnitTypeGUI\$refinery, mock_ilOrgUnitTypeGUI\__construct(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\refinery().

52  : NoUIFactory
53  {
54  $language = $this->createMock(ilLanguage::class);
55  $filter_factory = $this->createMock(Component\Input\Container\Filter\Factory::class);
56  $view_control_factory = $this->createMock(Component\Input\Container\ViewControl\Factory::class);
57  $control_factory = $this->createMock(Component\Input\ViewControl\Factory::class);
58  $upload_limit_resolver = $this->createMock(Component\Input\UploadLimitResolver::class);
59  $refinery = $this->getRefinery();
60 
61  $factory = new class (
62  $language,
63  $filter_factory,
64  $view_control_factory,
65  $control_factory,
66  $upload_limit_resolver,
67  $refinery
68  ) extends NoUIFactory {
69  public function __construct(
70  protected $language,
71  protected $filter_factory,
72  protected $view_control_factory,
73  protected $control_factory,
74  protected $upload_limit_resolver,
75  protected $refinery
76  ) {
77  }
78 
79  public function input(): ILIAS\UI\Component\Input\Factory
80  {
81  $signal_generator = new Component\SignalGenerator();
82  $data_factory = new \ILIAS\Data\Factory();
83 
84  $field_factory = new Component\Input\Field\Factory(
85  $this->upload_limit_resolver,
86  $signal_generator,
87  $data_factory,
88  $this->refinery,
89  $this->language
90  );
91 
92  $form_factory = new Component\Input\Container\Form\Factory(
93  $field_factory
94  );
95  $container_factory = new Component\Input\Container\Factory(
96  $form_factory,
97  $this->filter_factory,
98  $this->view_control_factory
99  );
100 
101  return new Component\Input\Factory(
102  $signal_generator,
103  $field_factory,
104  $container_factory,
105  $this->control_factory,
106  );
107  }
108  };
109  return $factory;
110  }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(VocabulariesInterface $vocabularies)
Refinery Factory $refinery
+ Here is the call graph for this function:

◆ testOrgUnitTypeGuiAMDForm()

ilModulesOrgUnitTypeTest::testOrgUnitTypeGuiAMDForm ( )

Definition at line 112 of file ilModulesOrgUnitTypeTest.php.

References ILIAS\UI\Implementation\Component\Input\$inputs.

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

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