mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Flasher\Pnotify\Laravel\Tests;
|
|
|
|
class NotifyPnotifyServiceProviderTest extends TestCase
|
|
{
|
|
public function testContainerContainNotifyServices()
|
|
{
|
|
$this->assertTrue($this->app->bound('notify.producer'));
|
|
$this->assertTrue($this->app->bound('notify.producer.pnotify'));
|
|
}
|
|
|
|
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['pnotify']);
|
|
}
|
|
|
|
public function testConfigPnotifyInjectedInGlobalNotifyConfig()
|
|
{
|
|
$manager = $this->app->make('notify.producer');
|
|
|
|
$reflection = new \ReflectionClass($manager);
|
|
$property = $reflection->getProperty('config');
|
|
$property->setAccessible(true);
|
|
|
|
$config = $property->getValue($manager);
|
|
|
|
$this->assertArrayHasKey('pnotify', $config->get('adapters'));
|
|
|
|
$this->assertEquals(array(
|
|
'pnotify' => array('scripts' => array('jquery.js'), 'styles' => array('styles.css'), 'options' => array()),
|
|
), $config->get('adapters'));
|
|
}
|
|
}
|