ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
FileTestBase.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 require_once(__DIR__ . "/../../../../../../../vendor/composer/vendor/autoload.php");
24 require_once(__DIR__ . "/../../../Base.php");
25 
28 use ILIAS\UI\Component as C;
30 
34 abstract class FileTestBase extends \ILIAS_UI_TestBase
35 {
36  protected C\Dropzone\File\Factory $factory;
37  protected I\Component\Input\Field\File $input;
38  private I\Component\Button\Factory $button_factory;
39 
40  public function setUp(): void
41  {
42  $this->button_factory = new I\Component\Button\Factory();
43 
44  $signal_generator = new I\Component\SignalGenerator();
45  $field_factory = new I\Component\Input\Field\Factory(
46  $this->createMock(\ILIAS\UI\Implementation\Component\Input\Field\Node\Factory::class),
47  $this->createMock(I\Component\Input\UploadLimitResolver::class),
48  $signal_generator,
49  $this->getDataFactory(),
50  $this->getRefinery(),
51  $this->getLanguage()
52  );
53 
54  $this->factory = new I\Component\Dropzone\File\Factory(
55  $signal_generator,
56  $field_factory,
57  );
58 
59  $this->input = $field_factory->file($this->createMock(C\Input\Field\UploadHandler::class), '');
60 
61  parent::setUp();
62  }
63 
68  public function getUIFactory(): \NoUIFactory
69  {
70  return new class ($this->button_factory) extends \NoUIFactory {
71  public function __construct(
72  protected I\Component\Button\Factory $button_factory,
73  ) {
74  }
75 
76  public function button(): I\Component\Button\Factory
77  {
78  return $this->button_factory;
79  }
80  };
81  }
82 }
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
factory()
getUIFactory()
Returns the factory with an actual implementation of the button factory.
getLanguage()
Provides common functionality for UI tests.
Definition: Base.php:333
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Builds data types.
Definition: Factory.php:35