fix laravel adapters tests

This commit is contained in:
Khoubza Younes
2020-12-13 08:07:49 +01:00
parent e254f35a4f
commit c7ddeff16e
2 changed files with 15 additions and 26 deletions
+8 -8
View File
@@ -2,6 +2,7 @@
namespace Flasher\Laravel\Middleware;
use Closure;
use Flasher\Prime\Config\ConfigInterface;
use Flasher\Prime\FlasherInterface;
use Flasher\Prime\Renderer\RendererInterface;
@@ -40,12 +41,12 @@ final class SessionMiddleware
/**
* Run the request filter.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param Request $request
* @param Closure $next
*
* @return mixed
*/
public function handle(Request $request, \Closure $next)
public function handle(Request $request, Closure $next)
{
/**
* @var Response $response
@@ -74,11 +75,10 @@ final class SessionMiddleware
$content = $response->getContent();
$htmlResponse = $this->renderer->render(array(),
array(
'format' => 'html',
'content' => $content,
));
$htmlResponse = $this->renderer->render(array(), array(
'format' => 'html',
'content' => $content,
));
if (empty($htmlResponse)) {
return $response;
+7 -18
View File
@@ -8,24 +8,13 @@ final class FlasherServiceProviderTest extends TestCase
{
public function testNotifyServiceExists()
{
$this->assertTrue($this->app->bound('flasher'));
$this->assertTrue($this->app->bound('flasher.renderer'));
$this->assertTrue($this->app->bound('flasher.storage'));
$this->assertTrue($this->app->bound('flasher.storage_manager'));
$this->assertTrue($this->app->bound('flasher.event_dispatcher'));
$this->assertTrue($this->app->bound('flasher.filter'));
$this->assertTrue($this->app->bound('flasher.config'));
}
public function testNotifyManagerGetConfig()
{
$notify = $this->app->make('flasher');
$reflection = new \ReflectionClass(get_class($notify));
$config = $reflection->getProperty('config');
$config->setAccessible(true);
$this->assertInstanceOf('Flasher\Prime\Config\ConfigInterface', $config->getValue($notify));
$this->assertInstanceOf('Flasher\Laravel\Config\Config', $this->app->make('flasher.config'));
$this->assertInstanceOf('Flasher\Prime\Flasher', $this->app->make('flasher'));
$this->assertInstanceOf('Flasher\Prime\Renderer\Renderer', $this->app->make('flasher.renderer'));
$this->assertInstanceOf('Flasher\Laravel\Storage\Storage', $this->app->make('flasher.storage'));
$this->assertInstanceOf('Flasher\Prime\Storage\StorageManager', $this->app->make('flasher.storage_manager'));
$this->assertInstanceOf('Flasher\Prime\EventDispatcher\EventDispatcher', $this->app->make('flasher.event_dispatcher'));
$this->assertInstanceOf('Flasher\Prime\Filter\Filter', $this->app->make('flasher.filter'));
}
public function testBladeDirective()