mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-11-21 01:16:35 +08:00
remove unnecessary code
This commit is contained in:
parent
e018ced5d8
commit
db74a9c051
@ -13,12 +13,6 @@ class RenderingFooter extends Event
|
||||
|
||||
public function addContent(string $content)
|
||||
{
|
||||
if ($content) {
|
||||
if (!is_string($content)) {
|
||||
throw new \Exception('Can not add non-string content', 1);
|
||||
}
|
||||
|
||||
$this->contents[] = $content;
|
||||
}
|
||||
$this->contents[] = $content;
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,6 @@ class RenderingHeader extends Event
|
||||
|
||||
public function addContent(string $content)
|
||||
{
|
||||
if ($content) {
|
||||
if (!is_string($content)) {
|
||||
throw new \Exception('Can not add non-string content', 1);
|
||||
}
|
||||
|
||||
$this->contents[] = $content;
|
||||
}
|
||||
$this->contents[] = $content;
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ namespace Tests;
|
||||
use App\Events\RenderingFooter;
|
||||
use App\Events\RenderingHeader;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use stdClass;
|
||||
|
||||
class HomeControllerTest extends TestCase
|
||||
{
|
||||
@ -23,11 +22,6 @@ class HomeControllerTest extends TestCase
|
||||
$event->addContent('testing custom header');
|
||||
});
|
||||
$this->get('/')->assertSee('testing custom header');
|
||||
|
||||
Event::listen(RenderingHeader::class, function (RenderingHeader $event) {
|
||||
$event->addContent(new stdClass());
|
||||
});
|
||||
$this->get('/');
|
||||
}
|
||||
|
||||
public function testRenderingFooterEvent()
|
||||
@ -36,11 +30,6 @@ class HomeControllerTest extends TestCase
|
||||
$event->addContent('testing custom footer');
|
||||
});
|
||||
$this->get('/')->assertSee('testing custom footer');
|
||||
|
||||
Event::listen(RenderingFooter::class, function (RenderingFooter $event) {
|
||||
$event->addContent(new stdClass());
|
||||
});
|
||||
$this->get('/');
|
||||
}
|
||||
|
||||
public function testApiRoot()
|
||||
|
Loading…
Reference in New Issue
Block a user