blessing-skin-server/tests/ListenersTest/NotifyFailedPluginTest.php
Pig Fang bb898ea2e4 Use message to report plugin errors
Instead of `notification`
2019-09-19 23:09:53 +08:00

30 lines
783 B
PHP

<?php
namespace Tests;
use App\Events;
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->actAs('normal');
event(new Events\PluginBootFailed($plugin));
event(new Events\RenderingFooter($content));
$this->assertCount(0, $content);
$this->actAs('admin');
event(new Events\PluginBootFailed($plugin));
event(new Events\RenderingFooter($content));
$this->assertStringContainsString('blessing.ui.message', $content[0]);
}
}