Files
php-flasher/Tests/NotifySweetAlertServiceProviderTest.php
T
2020-12-02 00:57:12 +01:00

44 lines
1.4 KiB
PHP

<?php
namespace Flasher\SweetAlert\Laravel\Tests;
class NotifySweetAlertServiceProviderTest extends TestCase
{
public function testContainerContainNotifyServices()
{
$this->assertTrue($this->app->bound('notify.producer'));
$this->assertTrue($this->app->bound('notify.producer.sweet_alert'));
}
public function testNotifyFactoryIsAddedToExtensionsArray()
{
$manager = $this->app->make('notify.producer');
$reflection = new \ReflectionClass($manager);
$property = $reflection->getProperty('drivers');
$property->setAccessible(true);
$extensions = $property->getValue($manager);
$this->assertCount(1, $extensions);
$this->assertInstanceOf('Flasher\Prime\FlasherInterface', $extensions['sweet_alert']);
}
public function testConfigSweetAlertInjectedInGlobalNotifyConfig()
{
$manager = $this->app->make('notify.producer');
$reflection = new \ReflectionClass($manager);
$property = $reflection->getProperty('config');
$property->setAccessible(true);
$config = $property->getValue($manager);
$this->assertArrayHasKey('sweet_alert', $config->get('adapters'));
$this->assertEquals(array(
'sweet_alert' => array('scripts' => array('jquery.js'), 'styles' => array('styles.css'), 'options' => array()),
), $config->get('adapters'));
}
}