mirror of
https://github.com/friendica/friendica
synced 2025-05-16 23:44:10 +02:00
Register hooks as event listener in API tests
This commit is contained in:
parent
90db7d2e65
commit
76c3eeb96e
1 changed files with 8 additions and 0 deletions
|
@ -11,6 +11,7 @@ use Friendica\Capabilities\ICanCreateResponses;
|
|||
use Friendica\Core\Addon\AddonHelper;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Hooks\HookEventBridge;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\Special\HTTPException;
|
||||
use Friendica\Security\Authentication;
|
||||
|
@ -159,6 +160,13 @@ abstract class ApiTestCase extends FixtureTestCase
|
|||
;
|
||||
DI::init($this->dice);
|
||||
|
||||
/** @var \Friendica\Event\EventDispatcher */
|
||||
$eventDispatcher = DI::eventDispatcher();
|
||||
|
||||
foreach (HookEventBridge::getStaticSubscribedEvents() as $eventName => $methodName) {
|
||||
$eventDispatcher->addListener($eventName, [HookEventBridge::class, $methodName]);
|
||||
}
|
||||
|
||||
$this->httpExceptionMock = $this->dice->create(HTTPException::class);
|
||||
|
||||
AuthTestConfig::$authenticated = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue