31 lines
870 B
PHP
31 lines
870 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use App\Events;
|
|
use App\Models\User;
|
|
use App\Services\Plugin;
|
|
|
|
class NotifyFailedPluginTest extends TestCase
|
|
{
|
|
public function testHandle()
|
|
{
|
|
$content = [];
|
|
$plugin = new Plugin('', ['title' => 'ff']);
|
|
|
|
event(new Events\PluginBootFailed($plugin));
|
|
event(new Events\RenderingFooter($content));
|
|
$this->assertCount(0, $content);
|
|
|
|
$this->actingAs(factory(User::class)->make());
|
|
event(new Events\PluginBootFailed($plugin));
|
|
event(new Events\RenderingFooter($content));
|
|
$this->assertCount(0, $content);
|
|
|
|
$this->actingAs(factory(User::class)->states('admin')->make());
|
|
event(new Events\PluginBootFailed($plugin));
|
|
event(new Events\RenderingFooter($content));
|
|
$this->assertStringContainsString('blessing.notify.toast', $content[0]);
|
|
}
|
|
}
|