mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 18:05:14 +02:00
Add support for HtmlFilterEvent in HookEventBridge
This commit is contained in:
parent
599ea41095
commit
00ff02da45
2 changed files with 25 additions and 3 deletions
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
namespace Friendica\Test\Unit\EventSubscriber;
|
||||
|
||||
use Friendica\Event\DataFilterEvent;
|
||||
use Friendica\Event\HtmlFilterEvent;
|
||||
use Friendica\EventSubscriber\HookEventBridge;
|
||||
use Friendica\EventSubscriber\StaticEventSubscriber;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
@ -28,6 +29,10 @@ class HookEventBridgeTest extends TestCase
|
|||
{
|
||||
$expected = [
|
||||
DataFilterEvent::class => 'onDataFilterEvent',
|
||||
HtmlFilterEvent::HEAD => 'onHtmlFilterEvent',
|
||||
HtmlFilterEvent::FOOTER => 'onHtmlFilterEvent',
|
||||
HtmlFilterEvent::PAGE_CONTENT_TOP => 'onHtmlFilterEvent',
|
||||
HtmlFilterEvent::PAGE_END => 'onHtmlFilterEvent',
|
||||
];
|
||||
|
||||
$this->assertSame(
|
||||
|
@ -35,12 +40,15 @@ class HookEventBridgeTest extends TestCase
|
|||
HookEventBridge::getStaticSubscribedEvents()
|
||||
);
|
||||
|
||||
foreach ($expected as $methodName) {
|
||||
$this->assertTrue(method_exists(HookEventBridge::class, $methodName));
|
||||
foreach (array_keys(array_flip($expected)) as $methodName) {
|
||||
$this->assertTrue(
|
||||
method_exists(HookEventBridge::class, $methodName),
|
||||
$methodName . '() is not defined'
|
||||
);
|
||||
|
||||
$this->assertTrue(
|
||||
(new \ReflectionMethod(HookEventBridge::class, $methodName))->isStatic(),
|
||||
$methodName . ' is not static'
|
||||
$methodName . '() is not static'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue