ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MainNotificationCollectorTest Class Reference

Class MainNotificationCollectorTest. More...

+ Inheritance diagram for MainNotificationCollectorTest:
+ Collaboration diagram for MainNotificationCollectorTest:

Public Member Functions

 testConstruct ()
 
 testHasNotifications ()
 
 testGetNotifications ()
 
 testGetAmountOfNewNotifications ()
 
 testGetAmountOfOldNotifications ()
 
 testGetNotificationsIdentifiersAsArray ()
 
- Public Member Functions inherited from BaseNotificationSetUp
 getUIFactory ()
 
 getDIC ()
 
 getDummyNotificationsProviderWithNotifications ($notifications)
 

Additional Inherited Members

- Protected Member Functions inherited from BaseNotificationSetUp
 setUp ()
 @inheritDoc More...
 
- Protected Attributes inherited from BaseNotificationSetUp
 $id
 
 $provider
 
 $identification
 
 $factory
 

Detailed Description

Member Function Documentation

◆ testConstruct()

MainNotificationCollectorTest::testConstruct ( )

Definition at line 26 of file MainNotificationCollectorTestTBD.php.

26 : void
27 {
29 $collector = new MainNotificationCollector([$povider]);
30 $this->assertInstanceOf(MainNotificationCollector::class, $collector);
31 }
getDummyNotificationsProviderWithNotifications($notifications)

References BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

+ Here is the call graph for this function:

◆ testGetAmountOfNewNotifications()

MainNotificationCollectorTest::testGetAmountOfNewNotifications ( )

Definition at line 65 of file MainNotificationCollectorTestTBD.php.

65 : void
66 {
68 $collector = new MainNotificationCollector([$povider]);
69 $this->assertSame(0, $collector->getAmountOfNewNotifications());
70
71 $group_notification = $this->factory->standardGroup($this->id);
72 $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
73 $collector = new MainNotificationCollector([$povider]);
74 $this->assertSame(0, $collector->getAmountOfNewNotifications());
75
76 $group_notification = $this->factory->standardGroup($this->id);
77 $standard_notification = $this->factory->standard($this->id)->withNewAmount(3);
78 $group_notification->addNotification($standard_notification);
79 $group_notification->addNotification($standard_notification);
80
81 $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
82 $collector = new MainNotificationCollector([$povider]);
83 $this->assertSame(4, $collector->getAmountOfNewNotifications());
84 }
factory()

References factory(), and BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

+ Here is the call graph for this function:

◆ testGetAmountOfOldNotifications()

MainNotificationCollectorTest::testGetAmountOfOldNotifications ( )

Definition at line 87 of file MainNotificationCollectorTestTBD.php.

87 : void
88 {
90 $collector = new MainNotificationCollector([$povider]);
91 $this->assertSame(0, $collector->getAmountOfOldNotifications());
92
93 $group_notification = $this->factory->standardGroup($this->id);
94 $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
95 $collector = new MainNotificationCollector([$povider]);
96 $this->assertSame(0, $collector->getAmountOfOldNotifications());
97
98 $group_notification = $this->factory->standardGroup($this->id);
99 $standard_notification = $this->factory->standard($this->id)->withOldAmount(3);
100 $group_notification->addNotification($standard_notification);
101 $group_notification->addNotification($standard_notification);
102
103 $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
104 $collector = new MainNotificationCollector([$povider]);
105 $this->assertSame(4, $collector->getAmountOfOldNotifications());
106 }

References factory(), and BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

+ Here is the call graph for this function:

◆ testGetNotifications()

MainNotificationCollectorTest::testGetNotifications ( )

Definition at line 47 of file MainNotificationCollectorTestTBD.php.

47 : void
48 {
50 $collector = new MainNotificationCollector([$povider]);
51 $this->assertSame([], $collector->getNotifications());
52
53 $group_notification = $this->factory->standardGroup($this->id);
54 $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
55 $collector = new MainNotificationCollector([$povider]);
56 $this->assertEquals([$group_notification], $collector->getNotifications());
57
58 $group_notification = $this->factory->standardGroup($this->id);
59 $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
60 $collector = new MainNotificationCollector([$povider]);
61 $this->assertEquals([$group_notification, $group_notification], $collector->getNotifications());
62 }

References factory(), and BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

+ Here is the call graph for this function:

◆ testGetNotificationsIdentifiersAsArray()

MainNotificationCollectorTest::testGetNotificationsIdentifiersAsArray ( )

Definition at line 109 of file MainNotificationCollectorTestTBD.php.

109 : void
110 {
112 $collector = new MainNotificationCollector([$provider]);
113
114 $this->assertSame([], $collector->getNotificationsIdentifiersAsArray());
115
116 $group_notification = $this->factory->standardGroup($this->id);
117 $provider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
118 $collector = new MainNotificationCollector([$provider]);
119
120 $this->assertEquals([$this->id->serialize()], $collector->getNotificationsIdentifiersAsArray());
121
122 $group_notification = $this->factory->standardGroup($this->id);
123 $provider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
124 $collector = new MainNotificationCollector([$provider]);
125
126 $this->assertEquals([$this->id->serialize(), $this->id->serialize()], $collector->getNotificationsIdentifiersAsArray());
127 }

References BaseNotificationSetUp\$provider, factory(), BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications(), and ILIAS\GlobalScreen\Provider\id().

+ Here is the call graph for this function:

◆ testHasNotifications()

MainNotificationCollectorTest::testHasNotifications ( )

Definition at line 34 of file MainNotificationCollectorTestTBD.php.

34 : void
35 {
37 $collector = new MainNotificationCollector([$povider]);
38 $this->assertFalse($collector->hasItems());
39
40 $group_notification = $this->factory->standardGroup($this->id);
41 $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
42 $collector = new MainNotificationCollector([$povider]);
43 $this->assertTrue($collector->hasItems());
44 }

References factory(), and BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

+ Here is the call graph for this function:

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