ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
BaseNotificationSetUp Class Reference

Class BaseNotificationSetUp. More...

+ Inheritance diagram for BaseNotificationSetUp:
+ Collaboration diagram for BaseNotificationSetUp:

Public Member Functions

 getUIFactory ()
 
 getDIC ()
 
 getDummyNotificationsProviderWithNotifications ($notifications)
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $id
 
 $provider
 
 $identification
 
 $factory
 

Detailed Description

Class BaseNotificationSetUp.

Some base Notification Work to be used in other tests for convenience

Definition at line 42 of file BaseNotificationSetUp.php.

Member Function Documentation

◆ getDIC()

BaseNotificationSetUp::getDIC ( )

Definition at line 117 of file BaseNotificationSetUp.php.

References ILIAS\Repository\globalScreen().

Referenced by getDummyNotificationsProviderWithNotifications().

118  {
119  $mocks = [
120  'ui' => $this->createMock(\ILIAS\DI\UIServices::class),
121  'ui.factory' => $this->createMock(\ILIAS\UI\Factory::class),
122  'provider_factory'=> $this->createMock(ProviderFactory::class),
123  ];
124  return new class ($mocks) extends ILIAS\DI\Container {
125  public function globalScreen(): Services
126  {
127  return new Services($this['provider_factory'], $this['ui']);
128  }
129  };
130  }
Class Factory.
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class HTTPServicesTest.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDummyNotificationsProviderWithNotifications()

BaseNotificationSetUp::getDummyNotificationsProviderWithNotifications (   $notifications)

Definition at line 132 of file BaseNotificationSetUp.php.

References $dic, $provider, and getDIC().

Referenced by MainNotificationCollectorTest\testConstruct(), DummyProviderTest\testConstruct(), MainNotificationCollectorTest\testGetAmountOfNewNotifications(), MainNotificationCollectorTest\testGetAmountOfOldNotifications(), MainNotificationCollectorTest\testGetNotifications(), MainNotificationCollectorTest\testGetNotificationsIdentifiersAsArray(), and MainNotificationCollectorTest\testHasNotifications().

133  {
134  $dic = $this->getDIC();
135  $provider = new class ($dic) extends AbstractNotificationProvider {
136  public function getNotifications(): array
137  {
138  return $this->notifications;
139  }
140  };
141  $provider->notifications = $notifications;
142  return $provider;
143  }
$dic
Definition: result.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUIFactory()

BaseNotificationSetUp::getUIFactory ( )

Definition at line 80 of file BaseNotificationSetUp.php.

References $factory.

Referenced by StandardNotificationGroupRendererTest\testConstruct(), StandardNotificationRendererTest\testConstruct(), StandardNotificationGroupRendererTest\testGetNotificationComponentForItem(), StandardNotificationRendererTest\testGetNotificationComponentForItem(), StandardNotificationRendererTest\testGetNotificationComponentForItemWithCloseCallable(), and StandardNotificationTest\testWithNotificationItem().

80  : NoUIFactory
81  {
82  $factory = new class () extends NoUIFactory {
83  public function item(): ILIAS\UI\Component\Item\Factory
84  {
85  return new I\Item\Factory();
86  }
87  public function symbol(): ILIAS\UI\Component\Symbol\Factory
88  {
89  return new I\Symbol\Factory(
90  new I\Symbol\Icon\Factory(),
91  new I\Symbol\Glyph\Factory(),
92  new I\Symbol\Avatar\Factory()
93  );
94  }
95  public function mainControls(): C\MainControls\Factory
96  {
97  return new I\MainControls\Factory(
98  $this->sig_gen,
99  new I\MainControls\Slate\Factory(
100  $this->sig_gen,
101  new Factory(),
102  new I\Symbol\Factory(
103  new I\Symbol\Icon\Factory(),
104  new I\Symbol\Glyph\Factory(),
105  new I\Symbol\Avatar\Factory()
106  )
107  )
108  );
109  }
110  };
111 
112  $factory->sig_gen = Mockery::mock(I\SignalGeneratorInterface::class);
113  $factory->sig_gen->shouldReceive("create")->andReturn(new I\Signal("id"));
114  return $factory;
115  }
Class Factory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ setUp()

BaseNotificationSetUp::setUp ( )
protected

Definition at line 67 of file BaseNotificationSetUp.php.

67  : void
68  {
69  parent::setUp();
70 
71  $this->identification = new IdentificationFactory(new NullProviderFactory());
72  $this->provider = \Mockery::mock(NotificationProvider::class);
73  $this->provider->shouldReceive('getProviderNameForPresentation')->andReturn('Provider');
74 
75  $this->id = $this->identification->core($this->provider)->identifier('dummy');
76 
77  $this->factory = new NotificationFactory();
78  }
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...

Field Documentation

◆ $factory

BaseNotificationSetUp::$factory
protected

Definition at line 61 of file BaseNotificationSetUp.php.

Referenced by getUIFactory().

◆ $id

BaseNotificationSetUp::$id
protected

Definition at line 49 of file BaseNotificationSetUp.php.

◆ $identification

BaseNotificationSetUp::$identification
protected

Definition at line 57 of file BaseNotificationSetUp.php.

◆ $provider


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