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)
|
public function addContent(string $content)
|
||||||
{
|
{
|
||||||
if ($content) {
|
$this->contents[] = $content;
|
||||||
if (!is_string($content)) {
|
|
||||||
throw new \Exception('Can not add non-string content', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->contents[] = $content;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,6 @@ class RenderingHeader extends Event
|
||||||
|
|
||||||
public function addContent(string $content)
|
public function addContent(string $content)
|
||||||
{
|
{
|
||||||
if ($content) {
|
$this->contents[] = $content;
|
||||||
if (!is_string($content)) {
|
|
||||||
throw new \Exception('Can not add non-string content', 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->contents[] = $content;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ namespace Tests;
|
||||||
use App\Events\RenderingFooter;
|
use App\Events\RenderingFooter;
|
||||||
use App\Events\RenderingHeader;
|
use App\Events\RenderingHeader;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use stdClass;
|
|
||||||
|
|
||||||
class HomeControllerTest extends TestCase
|
class HomeControllerTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
@ -23,11 +22,6 @@ class HomeControllerTest extends TestCase
|
||||||
$event->addContent('testing custom header');
|
$event->addContent('testing custom header');
|
||||||
});
|
});
|
||||||
$this->get('/')->assertSee('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()
|
public function testRenderingFooterEvent()
|
||||||
|
|
@ -36,11 +30,6 @@ class HomeControllerTest extends TestCase
|
||||||
$event->addContent('testing custom footer');
|
$event->addContent('testing custom footer');
|
||||||
});
|
});
|
||||||
$this->get('/')->assertSee('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()
|
public function testApiRoot()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user