blessing-skin-server/tests/ListenersTest/NotifyFailedPluginTest.php

30 lines
783 B
PHP
Raw Normal View History

2019-08-31 09:12:51 +08:00
<?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]);
2019-08-31 09:12:51 +08:00
}
}