Elgg\ActionsServiceTest::testActionHookIsTriggered PHP Method

testActionHookIsTriggered() public method

    public function testActionHookIsTriggered()
    {
        $this->hooks->registerHandler('action', 'output3', function ($hook, $type, $return, $params) {
            echo 'hello';
            return false;
        });
        $this->request = $this->prepareHttpRequest('action/output3', 'POST', [], false, true);
        $this->assertTrue($this->actions->register('output3', "{$this->actionsDir}/output3.php", 'public'));
        $this->createService();
        $result = $this->actions->execute('output3', 'referrer');
        $this->assertInstanceOf(OkResponse::class, $result);
        $this->assertEquals(ELGG_HTTP_OK, $result->getStatusCode());
        $this->assertEquals('referrer', $result->getForwardURL());
        $this->assertEquals('hello', $result->getContent());
    }
ActionsServiceTest