registerAspectXml() public method

Registers aspects written within source files which we might encounter
public registerAspectXml ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
return void
コード例 #1
0
 /**
  * Tests if we are able to reference multiple pointcuts for the same advice using XML
  *
  * @return void
  */
 public function testXmlAllowsForMultiPointcut()
 {
     $this->markTestSkipped('Strange behaviour related to \\Stackable usage. Skipped until an alternative has been found.');
     $configPath = $this->getMockWebappPath() . DIRECTORY_SEPARATOR . 'META-INF' . DIRECTORY_SEPARATOR . 'pointcuts.xml';
     $mockApplication = $this->getSpecificConfigMockApplication($configPath);
     // inject our mock and run the parsing process
     $this->testClass->injectApplication($mockApplication);
     $this->testClass->registerAspectXml($mockApplication);
     // did we get everything? Check for the expected advice
     $advicesList = $this->testClass->getAspectRegister()->get($configPath)->getAdvices();
     $this->assertTrue($advicesList->entryExists('\\AppserverIo\\Appserver\\NonExisting\\MetaInf\\Namespace\\TestAspect->metainfAdvice'));
     // check for the expected pointcuts the advice should reference
     $referencedPointcuts = $advicesList->get('\\AppserverIo\\Appserver\\NonExisting\\MetaInf\\Namespace\\TestAspect->metainfAdvice')->getPointcuts()->get(0)->getReferencedPointcuts();
     $this->assertCount(2, $referencedPointcuts);
 }