ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ViewControlTestBase.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26use ILIAS\Data;
27use ILIAS\Refinery\Factory as Refinery;
29
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(ILIAS\Language\Language::class)
56 );
57 }
58
59 protected function buildFieldFactory(): FieldFactory
60 {
61 return new FieldFactory(
62 $this->createMock(\ILIAS\UI\Implementation\Component\Input\Field\Node\Factory::class),
63 $this->createMock(UploadLimitResolver::class),
64 new SignalGenerator(),
65 $this->buildDataFactory(),
66 $this->buildRefinery(),
67 $this->getLanguage()
68 );
69 }
70
71 protected function buildVCFactory(): Control\Factory
72 {
73 return new Control\Factory(
74 $this->buildFieldFactory(),
75 $this->buildDataFactory(),
76 $this->buildRefinery(),
77 new SignalGenerator(),
78 $this->getLanguage(),
79 );
80 }
81
82 public function getUIFactory(): NoUIFactory
83 {
84 $factory = new class () extends NoUIFactory {
85 protected SignalGenerator $sig_gen;
86 public function __construct()
87 {
88 $this->sig_gen = new SignalGenerator();
89 }
90 public function button(): I\Button\Factory
91 {
92 return new I\Button\Factory();
93 }
94 public function symbol(): I\Symbol\Factory
95 {
96 return new I\Symbol\Factory(
97 new I\Symbol\Icon\Factory(),
98 new I\Symbol\Glyph\Factory(),
99 new I\Symbol\Avatar\Factory()
100 );
101 }
102 };
103 return $factory;
104 }
105
106 public function getDataFactory(): Data\Factory
107 {
108 return $this->buildDataFactory();
109 }
110}
Factory for Date Formats.
Definition: Factory.php:27
Builds data types.
Definition: Factory.php:36
Definition: UI.php:24
Provides common functionality for UI tests.
Definition: Base.php:337
This describes a symbol.
Definition: Symbol.php:30
Describes a source for input names.
Definition: NameSource.php:27
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
button(string $caption, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
getLanguage()