mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
fix all tests
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Flasher\Notyf\Laravel;
|
||||
|
||||
use Illuminate\Contracts\Support\DeferrableProvider;
|
||||
use Illuminate\Container\Container;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Flasher\Notyf\Laravel\ServiceProvider\ServiceProviderManager;
|
||||
|
||||
@@ -37,7 +37,7 @@ class FlasherNotyfServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Container\Container
|
||||
* @return Container
|
||||
*/
|
||||
public function getApplication()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ class Laravel implements ServiceProviderInterface
|
||||
|
||||
public function publishConfig(FlasherNotyfServiceProvider $provider)
|
||||
{
|
||||
$source = realpath($raw = __DIR__.'/../../../resources/config/config.php') ?: $raw;
|
||||
$source = realpath($raw = __DIR__.'/../../Resources/config/config.php') ?: $raw;
|
||||
|
||||
$provider->publishes(array($source => config_path('flasher_notyf.php')), 'config');
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ final class Laravel4 extends Laravel
|
||||
|
||||
public function publishConfig(FlasherNotyfServiceProvider $provider)
|
||||
{
|
||||
$provider->package('php-flasher/flasher-laravel-notyf', 'flasher_notyf', __DIR__.'/../../../resources');
|
||||
$provider->package('php-flasher/flasher-laravel-notyf', 'flasher_notyf', __DIR__.'/../../Resources');
|
||||
}
|
||||
|
||||
public function mergeConfigFromNotyf()
|
||||
|
||||
@@ -14,7 +14,7 @@ final class Lumen extends Laravel
|
||||
|
||||
public function publishConfig(FlasherNotyfServiceProvider $provider)
|
||||
{
|
||||
$source = realpath($raw = __DIR__.'/../../../resources/config/config.php') ?: $raw;
|
||||
$source = realpath($raw = __DIR__.'/../../Resources/config/config.php') ?: $raw;
|
||||
|
||||
$this->app->configure('flasher_notyf');
|
||||
|
||||
|
||||
+9
-9
@@ -2,37 +2,37 @@
|
||||
|
||||
namespace Flasher\Notyf\Laravel\Tests;
|
||||
|
||||
final class NotifyNotyfServiceProviderTest extends TestCase
|
||||
final class FlasherNotyfServiceProviderTest extends TestCase
|
||||
{
|
||||
public function testContainerContainNotifyServices()
|
||||
{
|
||||
$this->assertTrue($this->app->bound('flasher.factory'));
|
||||
$this->assertTrue($this->app->bound('flasher'));
|
||||
$this->assertTrue($this->app->bound('flasher.factory.notyf'));
|
||||
}
|
||||
|
||||
public function testNotifyFactoryIsAddedToExtensionsArray()
|
||||
{
|
||||
$manager = $this->app->make('flasher.factory');
|
||||
$flasher = $this->app->make('flasher');
|
||||
|
||||
$reflection = new \ReflectionClass($manager);
|
||||
$reflection = new \ReflectionClass($flasher);
|
||||
$property = $reflection->getProperty('drivers');
|
||||
$property->setAccessible(true);
|
||||
|
||||
$extensions = $property->getValue($manager);
|
||||
$extensions = $property->getValue($flasher);
|
||||
|
||||
$this->assertCount(1, $extensions);
|
||||
$this->assertInstanceOf('Flasher\Prime\FlasherInterface', $extensions['notyf']);
|
||||
$this->assertInstanceOf('Flasher\Prime\Factory\FlasherFactoryInterface', $extensions[0]);
|
||||
}
|
||||
|
||||
public function testConfigNotyfInjectedInGlobalNotifyConfig()
|
||||
{
|
||||
$manager = $this->app->make('flasher.factory');
|
||||
$flasher = $this->app->make('flasher');
|
||||
|
||||
$reflection = new \ReflectionClass($manager);
|
||||
$reflection = new \ReflectionClass($flasher);
|
||||
$property = $reflection->getProperty('config');
|
||||
$property->setAccessible(true);
|
||||
|
||||
$config = $property->getValue($manager);
|
||||
$config = $property->getValue($flasher);
|
||||
|
||||
$this->assertArrayHasKey('notyf', $config->get('adapters'));
|
||||
|
||||
+6
-7
@@ -9,31 +9,30 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Orchestra\Testbench\TestCase as Orchestra;
|
||||
|
||||
final class TestCase extends Orchestra
|
||||
class TestCase extends Orchestra
|
||||
{
|
||||
/**
|
||||
* @param \Illuminate\Foundation\Application $app
|
||||
* @param Application $app
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getPackageProviders($app = null)
|
||||
{
|
||||
return array(
|
||||
'Flasher\LaravelFlasher\PrimeServiceProvider',
|
||||
'Flasher\Notyf\LaravelFlasher\PrimeNotyfServiceProvider',
|
||||
'Flasher\Laravel\FlasherServiceProvider',
|
||||
'\Flasher\Notyf\Laravel\FlasherNotyfServiceProvider',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Illuminate\Foundation\Application $app
|
||||
* @param Application $app
|
||||
*/
|
||||
protected function getEnvironmentSetUp($app)
|
||||
{
|
||||
$separator = $this->isLaravel4() ? '::config' : '';
|
||||
|
||||
$app['config']->set('session'.$separator.'.driver', 'array');
|
||||
$app['config']->set('notify'.$separator.'.stamps_middlewares', array());
|
||||
$app['config']->set('notify'.$separator.'.adapters', array(
|
||||
$app['config']->set('flasher'.$separator.'.adapters', array(
|
||||
'notyf' => array('scripts' => array('jquery.js'), 'styles' => array('styles.css'), 'options' => array()),
|
||||
));
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">src/</directory>
|
||||
<directory suffix=".php">./</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
||||
Reference in New Issue
Block a user