Checks if the specified class matches with the class filter pattern
public matches ( string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier ) : boolean | ||
$className | string | Name of the class to check against |
$methodName | string | Name of the method - not used here |
$methodDeclaringClassName | string | Name of the class the method was originally declared in - not used here |
$pointcutQueryIdentifier | mixed | Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection. |
return | boolean | TRUE if the class matches, otherwise FALSE |
/** * Checks if the class filter fires on a concrete and simple class expression * * @test */ public function matchesTellsIfTheSpecifiedRegularExpressionMatchesTheGivenClassName() { $mockReflectionService = $this->getMockBuilder(ReflectionService::class)->disableOriginalConstructor()->getMock(); $classFilter = new Aop\Pointcut\PointcutClassNameFilter('Neos\\Virtual\\Foo\\Bar'); $classFilter->injectReflectionService($mockReflectionService); $this->assertTrue($classFilter->matches('Neos\\Virtual\\Foo\\Bar', '', '', 1), 'No. 1'); $classFilter = new Aop\Pointcut\PointcutClassNameFilter('.*Virtual.*'); $classFilter->injectReflectionService($mockReflectionService); $this->assertTrue($classFilter->matches('Neos\\Virtual\\Foo\\Bar', '', '', 1), 'No. 2'); $classFilter = new Aop\Pointcut\PointcutClassNameFilter('Neos\\Firtual.*'); $classFilter->injectReflectionService($mockReflectionService); $this->assertFalse($classFilter->matches('Neos\\Virtual\\Foo\\Bar', '', '', 1), 'No. 3'); }