Files
php-flasher/Tests/FlasherServiceProviderTest.php
T
2020-12-13 08:07:49 +01:00

28 lines
1.3 KiB
PHP

<?php
namespace Flasher\Laravel\Tests;
use Illuminate\View\Compilers\BladeCompiler;
final class FlasherServiceProviderTest extends TestCase
{
public function testNotifyServiceExists()
{
$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()
{
/** @var BladeCompiler $blade */
$blade = $this->app->make('view')->getEngineResolver()->resolve('blade')->getCompiler();
$this->assertEquals("<?php echo app('flasher.renderer')->render(array(), 'html'); ?>", $blade->compileString('@flasher_render()'));
}
}