ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 26 of file MainNotificationCollectorTestTBD.php.

References BaseNotificationSetUp\getDummyNotificationsProviderWithNotifications().

26  : void
27  {
29  $collector = new MainNotificationCollector([$povider]);
30  $this->assertInstanceOf(MainNotificationCollector::class, $collector);
31  }
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetAmountOfNewNotifications()

MainNotificationCollectorTest::testGetAmountOfNewNotifications ( )

Definition at line 65 of file MainNotificationCollectorTestTBD.php.

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

65  : void
66  {
68  $collector = new MainNotificationCollector([$povider]);
69  $this->assertEquals(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->assertEquals(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->assertEquals(4, $collector->getAmountOfNewNotifications());
84  }
factory()
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetAmountOfOldNotifications()

MainNotificationCollectorTest::testGetAmountOfOldNotifications ( )

Definition at line 87 of file MainNotificationCollectorTestTBD.php.

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

87  : void
88  {
90  $collector = new MainNotificationCollector([$povider]);
91  $this->assertEquals(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->assertEquals(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->assertEquals(4, $collector->getAmountOfOldNotifications());
106  }
factory()
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetNotifications()

MainNotificationCollectorTest::testGetNotifications ( )

Definition at line 47 of file MainNotificationCollectorTestTBD.php.

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

47  : void
48  {
50  $collector = new MainNotificationCollector([$povider]);
51  $this->assertEquals([], $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  }
factory()
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testGetNotificationsIdentifiersAsArray()

MainNotificationCollectorTest::testGetNotificationsIdentifiersAsArray ( )

Definition at line 109 of file MainNotificationCollectorTestTBD.php.

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

109  : void
110  {
112  $collector = new MainNotificationCollector([$provider]);
113 
114  $this->assertEquals([], $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  }
factory()
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

◆ testHasNotifications()

MainNotificationCollectorTest::testHasNotifications ( )

Definition at line 34 of file MainNotificationCollectorTestTBD.php.

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

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  }
factory()
getDummyNotificationsProviderWithNotifications($notifications)
+ Here is the call graph for this function:

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