You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-06 13:02:55 +01:00
31 lines
935 B
PHP
31 lines
935 B
PHP
<?php
|
|
|
|
namespace Flasher\Prime\Tests\Notification;
|
|
|
|
use Flasher\Prime\Notification\Notification;
|
|
use Flasher\Prime\Tests\TestCase;
|
|
|
|
final class NotificationTest extends TestCase
|
|
{
|
|
public function testNotification()
|
|
{
|
|
$notification = new Notification('message', 'type', array('timer' => 5000));
|
|
|
|
$this->assertSame('type', $notification->getType());
|
|
$this->assertSame('message', $notification->getMessage());
|
|
$this->assertSame(array('timer' => 5000), $notification->getOptions());
|
|
}
|
|
|
|
public function testAddOption()
|
|
{
|
|
$notification = new Notification('message', 'type', array('timer' => 5000));
|
|
$notification->setOption('toast', true);
|
|
|
|
$this->assertSame(array('timer' => 5000, 'toast' => true), $notification->getOptions());
|
|
|
|
$notification->unsetOption('timer');
|
|
|
|
$this->assertSame(array('toast' => true), $notification->getOptions());
|
|
}
|
|
}
|