22 require_once(__DIR__ .
"/../BaseNotificationSetUp.php");
31 $standard_notification = $this->
factory->standard($this->
id);
33 $this->assertInstanceOf(StandardNotification::class, $standard_notification);
34 $this->assertEquals($this->
id, $standard_notification->getProviderIdentification());
39 $icon = $this->
getUIFactory()->symbol()->icon()->standard(
"mail",
"mail");
40 $item = $this->
getUIFactory()->item()->notification(
"hello", $icon);
42 $standard_notification = $this->
factory->standard($this->
id)->withNotificationItem($item);
43 $this->assertEquals($item, $standard_notification->getNotificationItem());
48 $standard_notification = $this->
factory->standard($this->
id);
50 $this->assertEquals(1, $standard_notification->getNewAmount());
51 $standard_notification = $standard_notification->withNewAmount(13);
52 $this->assertEquals(13, $standard_notification->getNewAmount());
57 $standard_notification = $this->
factory->standard($this->
id);
59 $this->assertEquals(0, $standard_notification->getOldAmount());
60 $standard_notification = $standard_notification->withOldAmount(13);
61 $this->assertEquals(13, $standard_notification->getOldAmount());
69 $standard_notification = $this->
factory->standard($this->
id);
70 $this->assertEquals($this->
id, $standard_notification->getProviderIdentification());
75 $standard_notification = $this->
factory->standard($this->
id);
76 $this->assertInstanceOf(
77 StandardNotificationRenderer::class,
78 $standard_notification->getRenderer($this->getUIFactory())
84 $callable = (fn():
string =>
"something");
85 $standard_notification = $this->
factory->standard($this->
id);
86 $this->assertEquals(
function ():
void {
87 }, $standard_notification->getOpenedCallable());
88 $standard_notification = $standard_notification->withOpenedCallable($callable);
89 $this->assertEquals($callable, $standard_notification->getOpenedCallable());
93 $callable = (fn():
string =>
"something");
94 $standard_notification = $this->
factory->standard($this->
id);
95 $this->assertNull($standard_notification->getClosedCallable());
96 $standard_notification = $standard_notification->withClosedCallable($callable);
97 $this->assertEquals($callable, $standard_notification->getClosedCallable());
101 $callable = (fn():
string =>
"something");
102 $standard_notification = $this->
factory->standard($this->
id);
103 $this->assertFalse($standard_notification->hasClosedCallable());
104 $standard_notification = $standard_notification->withClosedCallable($callable);
105 $this->assertTrue($standard_notification->hasClosedCallable());
testGetProviderIdentification()
Tests on AbstractBaseNotification.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class BaseNotificationSetUp.
Class StandardNotificationTest.
testWithNotificationItem()