ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
StandardNotificationTest Class Reference

Class StandardNotificationTest. More...

+ Inheritance diagram for StandardNotificationTest:
+ Collaboration diagram for StandardNotificationTest:

Public Member Functions

 testConstructByFactory ()
 
 testWithNotificationItem ()
 
 testWithNewAmout ()
 
 testWithOldAmout ()
 
 testGetProviderIdentification ()
 Tests on AbstractBaseNotification. More...
 
 testGetRenderer ()
 
 testWithOpenedCallable ()
 
 testWithClosedCallable ()
 
 testHasClosedCallable ()
 
- 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

Class StandardNotificationTest.

Definition at line 10 of file StandardNotificationTest.php.

Member Function Documentation

◆ testConstructByFactory()

StandardNotificationTest::testConstructByFactory ( )

Definition at line 12 of file StandardNotificationTest.php.

13  {
14  $standard_notification = $this->factory->standard($this->id);
15 
16  $this->assertInstanceOf(StandardNotification::class, $standard_notification);
17  $this->assertEquals($this->id, $standard_notification->getProviderIdentification());
18  }

◆ testGetProviderIdentification()

StandardNotificationTest::testGetProviderIdentification ( )

Tests on AbstractBaseNotification.

Definition at line 50 of file StandardNotificationTest.php.

51  {
52  $standard_notification = $this->factory->standard($this->id);
53  $this->assertEquals($this->id, $standard_notification->getProviderIdentification());
54  }

◆ testGetRenderer()

StandardNotificationTest::testGetRenderer ( )

Definition at line 56 of file StandardNotificationTest.php.

57  {
58  $standard_notification = $this->factory->standard($this->id);
59  $this->assertInstanceOf(
60  StandardNotificationRenderer::class,
61  $standard_notification->getRenderer($this->getUIFactory())
62  );
63  }

◆ testHasClosedCallable()

StandardNotificationTest::testHasClosedCallable ( )

Definition at line 86 of file StandardNotificationTest.php.

87  {
88  $callable = function () {
89  return "something";
90  };
91  $standard_notification = $this->factory->standard($this->id);
92  $this->assertFalse($standard_notification->hasClosedCallable());
93  $standard_notification = $standard_notification->withClosedCallable($callable);
94  $this->assertTrue($standard_notification->hasClosedCallable());
95  }

◆ testWithClosedCallable()

StandardNotificationTest::testWithClosedCallable ( )

Definition at line 76 of file StandardNotificationTest.php.

77  {
78  $callable = function () {
79  return "something";
80  };
81  $standard_notification = $this->factory->standard($this->id);
82  $this->assertNull($standard_notification->getClosedCallable());
83  $standard_notification = $standard_notification->withClosedCallable($callable);
84  $this->assertEquals($callable, $standard_notification->getClosedCallable());
85  }

◆ testWithNewAmout()

StandardNotificationTest::testWithNewAmout ( )

Definition at line 29 of file StandardNotificationTest.php.

30  {
31  $standard_notification = $this->factory->standard($this->id);
32 
33  $this->assertEquals(1, $standard_notification->getNewAmount());
34  $standard_notification = $standard_notification->withNewAmount(13);
35  $this->assertEquals(13, $standard_notification->getNewAmount());
36  }

◆ testWithNotificationItem()

StandardNotificationTest::testWithNotificationItem ( )

Definition at line 20 of file StandardNotificationTest.php.

References BaseNotificationSetUp\getUIFactory().

21  {
22  $icon = $this->getUIFactory()->symbol()->icon()->standard("mail", "mail");
23  $item = $this->getUIFactory()->item()->notification("hello", $icon);
24 
25  $standard_notification = $this->factory->standard($this->id)->withNotificationItem($item);
26  $this->assertEquals($item, $standard_notification->getNotificationItem());
27  }
+ Here is the call graph for this function:

◆ testWithOldAmout()

StandardNotificationTest::testWithOldAmout ( )

Definition at line 38 of file StandardNotificationTest.php.

39  {
40  $standard_notification = $this->factory->standard($this->id);
41 
42  $this->assertEquals(0, $standard_notification->getOldAmount());
43  $standard_notification = $standard_notification->withOldAmount(13);
44  $this->assertEquals(13, $standard_notification->getOldAmount());
45  }

◆ testWithOpenedCallable()

StandardNotificationTest::testWithOpenedCallable ( )

Definition at line 65 of file StandardNotificationTest.php.

66  {
67  $callable = function () {
68  return "something";
69  };
70  $standard_notification = $this->factory->standard($this->id);
71  $this->assertEquals(function () {
72  }, $standard_notification->getOpenedCallable());
73  $standard_notification = $standard_notification->withOpenedCallable($callable);
74  $this->assertEquals($callable, $standard_notification->getOpenedCallable());
75  }

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