/** * @param $method * @param $transaction * @return array */ private function getCallbacksFromMethodCall($method, $transaction) { $propertyName = $this->getPropertyNameFromMethodCall($method); return Hooks::getCallbacksForName($propertyName, $transaction); }
/** * @test */ public function it_can_get_hooks_with_wildcards() { $transaction = new stdClass(); $transaction->name = 'Admin > Test'; Hooks::before('Admin > *', function (&$transaction) { }); $hooks = Hooks::getCallbacksForName('beforeHooks', $transaction); $this->assertCount(1, $hooks); $this->assertTrue(is_a($hooks[0], $this->className), sprintf("Expected %s received %s", $this->className, get_class($hooks[0]))); }