Files
php-flasher/Tests/NotifyToastrServiceProviderTest.php
T
2020-12-06 19:16:55 +01:00

44 lines
1.3 KiB
PHP

<?php
namespace Flasher\Toastr\Laravel\Tests;
class NotifyToastrServiceProviderTest extends TestCase
{
public function testContainerContainNotifyServices()
{
$this->assertTrue($this->app->bound('flasher'));
$this->assertTrue($this->app->bound('flasher.factory.toastr'));
}
public function testNotifyFactoryIsAddedToExtensionsArray()
{
$flasher = $this->app->make('flasher');
$reflection = new \ReflectionClass($flasher);
$property = $reflection->getProperty('drivers');
$property->setAccessible(true);
$extensions = $property->getValue($flasher);
$this->assertCount(1, $extensions);
$this->assertInstanceOf('Flasher\Prime\Factory\FlasherFactoryInterface', $extensions[0]);
}
public function testConfigToastrInjectedInGlobalNotifyConfig()
{
$flasher = $this->app->make('flasher');
$reflection = new \ReflectionClass($flasher);
$property = $reflection->getProperty('config');
$property->setAccessible(true);
$config = $property->getValue($flasher);
$this->assertArrayHasKey('toastr', $config->get('adapters'));
$this->assertEquals(array(
'toastr' => array('scripts' => array('jquery.js'), 'styles' => array('styles.css'), 'options' => array()),
), $config->get('adapters'));
}
}