assertTrue(\OC_Hook::emit('LegacyHookTest', 'error')); $this->assertCount(1, \OC_Hook::$thrownExceptions); $this->assertInstanceOf(\TypeError::class, \OC_Hook::$thrownExceptions[0]); } public function testEmitRethrowsHintException(): void { \OC_Hook::connect('LegacyHookTest', 'hint', self::class, 'throwHintException'); $this->expectException(HintException::class); \OC_Hook::emit('LegacyHookTest', 'hint'); } }