ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ViewControlBaseTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 use ILIAS\Data;
29 
30 abstract class ViewControlBaseTest extends ILIAS_UI_TestBase
31 {
32  protected function getNamesource()
33  {
34  return new class () implements NameSource {
35  public int $count = 0;
36  public function getNewName(): string
37  {
38  $name = "name_{$this->count}";
39  $this->count++;
40 
41  return $name;
42  }
43  };
44  }
45 
46  protected function buildDataFactory(): Data\Factory
47  {
48  return new Data\Factory();
49  }
50 
51  protected function buildRefinery(): Refinery
52  {
53  return new Refinery(
54  $this->buildDataFactory(),
55  $this->createMock(ilLanguage::class)
56  );
57  }
58 
59  protected function buildFieldFactory(): FieldFactory
60  {
61  return new FieldFactory(
62  $this->createMock(UploadLimitResolver::class),
63  new SignalGenerator(),
64  $this->buildDataFactory(),
65  $this->buildRefinery(),
66  $this->getLanguage()
67  );
68  }
69 
70  protected function buildVCFactory(): Control\Factory
71  {
72  return new Control\Factory(
73  $this->buildFieldFactory(),
74  $this->buildDataFactory(),
75  $this->buildRefinery(),
76  new SignalGenerator(),
77  $this->getLanguage(),
78  );
79  }
80 
81  public function getUIFactory(): NoUIFactory
82  {
83  $factory = new class () extends NoUIFactory {
84  public function button(): I\Button\Factory
85  {
86  return new I\Button\Factory(
87  new SignalGenerator()
88  );
89  }
90  public function symbol(): ILIAS\UI\Component\Symbol\Factory
91  {
92  return new I\Symbol\Factory(
93  new I\Symbol\Icon\Factory(),
94  new I\Symbol\Glyph\Factory(),
95  new I\Symbol\Avatar\Factory()
96  );
97  }
98  };
99  $factory->sig_gen = new SignalGenerator();
100  return $factory;
101  }
102 
103  public function getDataFactory(): Data\Factory
104  {
105  return $this->buildDataFactory();
106  }
107 }
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...
if($format !==null) $name
Definition: metadata.php:247
Provides common functionality for UI tests.
Definition: Base.php:298
Builds data types.
Definition: Factory.php:20
Describes a source for input names.
Definition: NameSource.php:26
$factory
Definition: metadata.php:75
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21