You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Flasher\SweetAlert\Laravel\Tests;
|
|
|
|
class FlasherSweetAlertServiceProviderTest extends TestCase
|
|
{
|
|
public function testContainerContainNotifyServices()
|
|
{
|
|
$this->assertTrue($this->app->bound('flasher'));
|
|
$this->assertTrue($this->app->bound('flasher.factory.sweet_alert'));
|
|
}
|
|
|
|
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\FactoryInterface', $extensions[0]);
|
|
}
|
|
|
|
public function testConfigSweetAlertInjectedInGlobalNotifyConfig()
|
|
{
|
|
$flasher = $this->app->make('flasher');
|
|
|
|
$reflection = new \ReflectionClass($flasher);
|
|
$property = $reflection->getProperty('config');
|
|
$property->setAccessible(true);
|
|
|
|
$config = $property->getValue($flasher);
|
|
|
|
$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'));
|
|
}
|
|
}
|