ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 @inheritDoc More...
 

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 BaseNotificationSetUpTBD.php.

Member Function Documentation

◆ getDIC()

BaseNotificationSetUp::getDIC ( )

Definition at line 118 of file BaseNotificationSetUpTBD.php.

118 : Container
119 {
120 $mocks = [
121 'ui' => $this->createMock(UIServices::class),
122 'ui.factory' => $this->createMock(\ILIAS\UI\Factory::class),
123 'provider_factory' => $this->createMock(ProviderFactory::class),
124 ];
125 return new class ($mocks) extends Container {
126 public function globalScreen(): Services
127 {
128 return new Services($this['provider_factory'], $this['ui']);
129 }
130 };
131 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References ILIAS\Repository\globalScreen().

Referenced by getDummyNotificationsProviderWithNotifications().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDummyNotificationsProviderWithNotifications()

BaseNotificationSetUp::getDummyNotificationsProviderWithNotifications (   $notifications)

Definition at line 133 of file BaseNotificationSetUpTBD.php.

134 {
135 $dic = $this->getDIC();
136 $provider = new class ($dic) extends AbstractNotificationProvider {
137 public array $notifications = [];
138
139 public function getNotifications(): array
140 {
141 return $this->notifications;
142 }
143 };
144 $provider->notifications = $notifications;
145 return $provider;
146 }
$dic
Definition: ltiresult.php:33

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUIFactory()

BaseNotificationSetUp::getUIFactory ( )

Definition at line 79 of file BaseNotificationSetUpTBD.php.

80 {
81 $factory = new class () extends NoUIFactory {
82 public function item(): I\Item\Factory
83 {
84 return new I\Item\Factory();
85 }
86
87 public function symbol(): I\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
96 public function mainControls(): I\MainControls\Factory
97 {
98 return new I\MainControls\Factory(
99 $this->sig_gen,
100 new I\MainControls\Slate\Factory(
101 $this->sig_gen,
102 new Factory(),
103 new I\Symbol\Factory(
104 new I\Symbol\Icon\Factory(),
105 new I\Symbol\Glyph\Factory(),
106 new I\Symbol\Avatar\Factory()
107 )
108 )
109 );
110 }
111 };
112
113 $factory->sig_gen = Mockery::mock(I\SignalGeneratorInterface::class);
114 $factory->sig_gen->shouldReceive("create")->andReturn(new I\Signal("id"));
115 return $factory;
116 }

References $factory, and ILIAS\Repository\symbol().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

BaseNotificationSetUp::setUp ( )
protected

@inheritDoc

Reimplemented in StandardNotificationRendererTest.

Definition at line 66 of file BaseNotificationSetUpTBD.php.

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

References factory().

+ Here is the call graph for this function:

Field Documentation

◆ $factory

BaseNotificationSetUp::$factory
protected

Definition at line 61 of file BaseNotificationSetUpTBD.php.

Referenced by getUIFactory().

◆ $id

BaseNotificationSetUp::$id
protected

Definition at line 49 of file BaseNotificationSetUpTBD.php.

◆ $identification

BaseNotificationSetUp::$identification
protected

Definition at line 57 of file BaseNotificationSetUpTBD.php.

◆ $provider


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