Neos\Flow\Tests\Unit\Aop\Pointcut\PointcutClassAnnotatedWithFilterTest::matchesTellsIfTheSpecifiedRegularExpressionMatchesTheGivenAnnotation PHP Метод

matchesTellsIfTheSpecifiedRegularExpressionMatchesTheGivenAnnotation() публичный Метод

    public function matchesTellsIfTheSpecifiedRegularExpressionMatchesTheGivenAnnotation()
    {
        $mockReflectionService = $this->createMock(ReflectionService::class, ['getClassAnnotations'], [], '', false, true);
        $mockReflectionService->expects($this->any())->method('getClassAnnotations')->with('Acme\\Some\\Class', 'Acme\\Some\\Annotation')->will($this->onConsecutiveCalls(['SomeAnnotation'], []));
        $filter = new Aop\Pointcut\PointcutClassAnnotatedWithFilter('Acme\\Some\\Annotation');
        $filter->injectReflectionService($mockReflectionService);
        $this->assertTrue($filter->matches('Acme\\Some\\Class', 'foo', 'Acme\\Some\\Other\\Class', 1234));
        $this->assertFalse($filter->matches('Acme\\Some\\Class', 'foo', 'Acme\\Some\\Other\\Class', 1234));
    }