registerPointcut() public method

Store the pointcut in the container
public registerPointcut ( Go\Aop\Pointcut $pointcut, string $id )
$pointcut Go\Aop\Pointcut Instance
$id string Key for pointcut
コード例 #1
0
 /**
  * Tests that pointcut can be registered and accessed
  */
 public function testPointcutCanBeRegisteredAndReceived()
 {
     $pointcut = $this->getMock(Pointcut::class);
     $this->container->registerPointcut($pointcut, 'test');
     $this->assertSame($pointcut, $this->container->getPointcut('test'));
     // Verify that tag is working
     $pointcuts = $this->container->getByTag('pointcut');
     $this->assertSame(array('pointcut.test' => $pointcut), $pointcuts);
 }