diff --git a/ServiceProvider/Providers/Laravel.php b/ServiceProvider/Providers/Laravel.php index 329ca057..7dc7e78e 100644 --- a/ServiceProvider/Providers/Laravel.php +++ b/ServiceProvider/Providers/Laravel.php @@ -26,7 +26,7 @@ class Laravel implements ServiceProviderInterface public function publishConfig(FlasherToastrServiceProvider $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_toastr.php')), 'config'); @@ -46,7 +46,7 @@ class Laravel implements ServiceProviderInterface $this->app->alias('flasher.factory.toastr', 'Flasher\Toastr\Prime\ToastrFactory'); $this->app->alias('flasher.renderer.toastr', 'Flasher\Toastr\Prime\ToastrRenderer'); - $this->app->extend('flasher.factory', function (Flasher $flasher, Container $app) { + $this->app->extend('flasher', function (Flasher $flasher, Container $app) { $flasher->addDriver($app['flasher.factory.toastr']); return $flasher; diff --git a/ServiceProvider/Providers/Laravel4.php b/ServiceProvider/Providers/Laravel4.php index ba2ec911..aec7d288 100644 --- a/ServiceProvider/Providers/Laravel4.php +++ b/ServiceProvider/Providers/Laravel4.php @@ -14,7 +14,7 @@ final class Laravel4 extends Laravel public function publishConfig(FlasherToastrServiceProvider $provider) { - $provider->package('php-flasher/flasher-laravel-toastr', 'flasher_toastr', __DIR__.'/../../../resources'); + $provider->package('php-flasher/flasher-laravel-toastr', 'flasher_toastr', __DIR__.'/../../Resources'); } public function mergeConfigFromToastr() diff --git a/ServiceProvider/Providers/Lumen.php b/ServiceProvider/Providers/Lumen.php index fd742fcc..ffb2023a 100644 --- a/ServiceProvider/Providers/Lumen.php +++ b/ServiceProvider/Providers/Lumen.php @@ -14,7 +14,7 @@ final class Lumen extends Laravel public function publishConfig(FlasherToastrServiceProvider $provider) { - $source = realpath($raw = __DIR__.'/../../../resources/config/config.php') ?: $raw; + $source = realpath($raw = __DIR__.'/../../Resources/config/config.php') ?: $raw; $this->app->configure('flasher_toastr'); diff --git a/Tests/NotifyToastrServiceProviderTest.php b/Tests/NotifyToastrServiceProviderTest.php index c37f058d..1075838d 100644 --- a/Tests/NotifyToastrServiceProviderTest.php +++ b/Tests/NotifyToastrServiceProviderTest.php @@ -6,33 +6,33 @@ class NotifyToastrServiceProviderTest 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.toastr')); } 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['toastr']); + $this->assertInstanceOf('Flasher\Prime\Factory\FlasherFactoryInterface', $extensions[0]); } public function testConfigToastrInjectedInGlobalNotifyConfig() { - $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('toastr', $config->get('adapters')); diff --git a/Tests/TestCase.php b/Tests/TestCase.php index 22983167..fff72c2f 100644 --- a/Tests/TestCase.php +++ b/Tests/TestCase.php @@ -12,28 +12,27 @@ use Orchestra\Testbench\TestCase as 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\Toastr\LaravelFlasher\PrimeToastrServiceProvider', + 'Flasher\Laravel\FlasherServiceProvider', + 'Flasher\Toastr\Laravel\FlasherToastrServiceProvider', ); } /** - * @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( 'toastr' => array('scripts' => array('jquery.js'), 'styles' => array('styles.css'), 'options' => array()), )); } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2621c486..1e1af721 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ - src/ + ./