ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 ()
 
- Protected Attributes inherited from BaseNotificationSetUp
 $id
 
 $provider
 
 $identification
 
 $factory
 

Detailed Description

Member Function Documentation

◆ testConstruct()

MainNotificationCollectorTest::testConstruct ( )

Definition at line 10 of file MainNotificationCollectorTestTBD.php.

References BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

10  : void
11  {
13  $collector = new MainNotificationCollector([$povider]);
14  $this->assertInstanceOf(MainNotificationCollector::class, $collector);
15  }
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetAmountOfNewNotifications()

MainNotificationCollectorTest::testGetAmountOfNewNotifications ( )

Definition at line 49 of file MainNotificationCollectorTestTBD.php.

References BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

49  : void
50  {
52  $collector = new MainNotificationCollector([$povider]);
53  $this->assertEquals(0, $collector->getAmountOfNewNotifications());
54 
55  $group_notification = $this->factory->standardGroup($this->id);
56  $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
57  $collector = new MainNotificationCollector([$povider]);
58  $this->assertEquals(0, $collector->getAmountOfNewNotifications());
59 
60  $group_notification = $this->factory->standardGroup($this->id);
61  $standard_notification = $this->factory->standard($this->id)->withNewAmount(3);
62  $group_notification->addNotification($standard_notification);
63  $group_notification->addNotification($standard_notification);
64 
65  $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
66  $collector = new MainNotificationCollector([$povider]);
67  $this->assertEquals(4, $collector->getAmountOfNewNotifications());
68  }
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetAmountOfOldNotifications()

MainNotificationCollectorTest::testGetAmountOfOldNotifications ( )

Definition at line 71 of file MainNotificationCollectorTestTBD.php.

References BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

71  : void
72  {
74  $collector = new MainNotificationCollector([$povider]);
75  $this->assertEquals(0, $collector->getAmountOfOldNotifications());
76 
77  $group_notification = $this->factory->standardGroup($this->id);
78  $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
79  $collector = new MainNotificationCollector([$povider]);
80  $this->assertEquals(0, $collector->getAmountOfOldNotifications());
81 
82  $group_notification = $this->factory->standardGroup($this->id);
83  $standard_notification = $this->factory->standard($this->id)->withOldAmount(3);
84  $group_notification->addNotification($standard_notification);
85  $group_notification->addNotification($standard_notification);
86 
87  $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
88  $collector = new MainNotificationCollector([$povider]);
89  $this->assertEquals(4, $collector->getAmountOfOldNotifications());
90  }
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetNotifications()

MainNotificationCollectorTest::testGetNotifications ( )

Definition at line 31 of file MainNotificationCollectorTestTBD.php.

References BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

31  : void
32  {
34  $collector = new MainNotificationCollector([$povider]);
35  $this->assertEquals([], $collector->getNotifications());
36 
37  $group_notification = $this->factory->standardGroup($this->id);
38  $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
39  $collector = new MainNotificationCollector([$povider]);
40  $this->assertEquals([$group_notification], $collector->getNotifications());
41 
42  $group_notification = $this->factory->standardGroup($this->id);
43  $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
44  $collector = new MainNotificationCollector([$povider]);
45  $this->assertEquals([$group_notification, $group_notification], $collector->getNotifications());
46  }
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetNotificationsIdentifiersAsArray()

MainNotificationCollectorTest::testGetNotificationsIdentifiersAsArray ( )

Definition at line 93 of file MainNotificationCollectorTestTBD.php.

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

93  : void
94  {
96  $collector = new MainNotificationCollector([$provider]);
97 
98  $this->assertEquals([], $collector->getNotificationsIdentifiersAsArray());
99 
100  $group_notification = $this->factory->standardGroup($this->id);
101  $provider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
102  $collector = new MainNotificationCollector([$provider]);
103 
104  $this->assertEquals([$this->id->serialize()], $collector->getNotificationsIdentifiersAsArray());
105 
106  $group_notification = $this->factory->standardGroup($this->id);
107  $provider = $this->getDummyNotificationsProviderWithNotifications([$group_notification, $group_notification]);
108  $collector = new MainNotificationCollector([$provider]);
109 
110  $this->assertEquals([$this->id->serialize(), $this->id->serialize()], $collector->getNotificationsIdentifiersAsArray());
111  }
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testHasNotifications()

MainNotificationCollectorTest::testHasNotifications ( )

Definition at line 18 of file MainNotificationCollectorTestTBD.php.

References BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

18  : void
19  {
21  $collector = new MainNotificationCollector([$povider]);
22  $this->assertFalse($collector->hasItems());
23 
24  $group_notification = $this->factory->standardGroup($this->id);
25  $povider = $this->getDummyNotificationsProviderWithNotifications([$group_notification]);
26  $collector = new MainNotificationCollector([$povider]);
27  $this->assertTrue($collector->hasItems());
28  }
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

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