registerAspect() public method

Register an aspect in the container
public registerAspect ( Go\Aop\Aspect $aspect )
$aspect Go\Aop\Aspect Instance of concrete aspect
Exemplo n.º 1
0
 /**
  * Tests that aspect can be registered and accessed
  */
 public function testAspectCanBeRegisteredAndReceived()
 {
     $aspect = $this->getMock(Aspect::class);
     $aspectClass = get_class($aspect);
     $this->container->registerAspect($aspect);
     $this->assertSame($aspect, $this->container->getAspect($aspectClass));
     // Verify that tag is working
     $aspects = $this->container->getByTag('aspect');
     $this->assertSame(array("aspect.{$aspectClass}" => $aspect), $aspects);
 }