Store the advisor in the container
public registerAdvisor ( Go\Aop\Advisor $advisor, string $id ) | ||
$advisor | Go\Aop\Advisor | Instance |
$id | string | Key for advisor |
/** * Tests that pointcut can be registered and accessed */ public function testAdvisorCanBeRegistered() { $advisor = $this->getMock(Advisor::class); $this->container->registerAdvisor($advisor, 'test'); // Verify that tag is working $advisors = $this->container->getByTag('advisor'); $this->assertSame(array('advisor.test' => $advisor), $advisors); }