ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
BaseNotificationSetUp.php
Go to the documentation of this file.
1 <?php
11 use \ILIAS\UI\Component as C;
12 
14 use \ILIAS\UI\Implementation\Component as I;
15 
16 require_once('./libs/composer/vendor/autoload.php');
17 require_once(__DIR__ . "/../../UI/Base.php");
18 
24 abstract class BaseNotificationSetUp extends TestCase
25 {
27 
31  protected $id;
35  protected $provider;
39  protected $identification;
43  protected $factory;
44 
45 
49  protected function setUp() : void
50  {
51  parent::setUp();
52 
53  $this->identification = new IdentificationFactory(new NullProviderFactory());
54  $this->provider = \Mockery::mock(NotificationProvider::class);
55  $this->provider->shouldReceive('getProviderNameForPresentation')->andReturn('Provider');
56 
57  $this->id = $this->identification->core($this->provider)->identifier('dummy');
58 
59  $this->factory = new NotificationFactory();
60  }
61 
62  public function getUIFactory()
63  {
64  $factory = new class extends NoUIFactory {
65  public function item()
66  {
67  return new I\Item\Factory();
68  }
69  public function symbol() : ILIAS\UI\Component\Symbol\Factory
70  {
71  return new I\Symbol\Factory(
72  new I\Symbol\Icon\Factory(),
73  new I\Symbol\Glyph\Factory(),
74  new I\Symbol\Avatar\Factory()
75  );
76  }
77  public function mainControls() : C\MainControls\Factory
78  {
79  return new I\MainControls\Factory(
80  $this->sig_gen,
81  new I\MainControls\Slate\Factory(
82  $this->sig_gen,
83  new \ILIAS\UI\Implementation\Component\Counter\Factory(),
84  new I\Symbol\Factory(
85  new I\Symbol\Icon\Factory(),
86  new I\Symbol\Glyph\Factory(),
87  new I\Symbol\Avatar\Factory()
88  )
89  )
90  );
91  }
92  };
93 
94  $factory->sig_gen = Mockery::mock(I\SignalGeneratorInterface::class);
95  $factory->sig_gen->shouldReceive("create")->andReturn(new I\Signal("id"));
96  return $factory;
97  }
98 
99  public function getDIC()
100  {
101  $dic = new class extends ILIAS\DI\Container {
102  public function globalScreen()
103  {
104  return new Services(Mockery::mock(ProviderFactory::class));
105  }
106  };
107  return $dic;
108  }
109 
110  public function getDummyNotificationsProviderWithNotifications($notifications)
111  {
112  $dic = $this->getDIC();
113  $provider = new class($dic) extends AbstractNotificationProvider {
114  public function getNotifications() : array
115  {
116  return $this->notifications;
117  }
118  };
119  $provider->notifications = $notifications;
120  return $provider;
121  }
122 }
Class Factory.
Class BaseNotificationSetUp.
Class ChatMainBarProvider .
getDummyNotificationsProviderWithNotifications($notifications)
$dic
Definition: result.php:13
Class ilAsqQuestionAuthoringFactory.