Neos\Flow\Tests\Unit\Aop\Pointcut\PointcutMethodNameFilterTest::matchesIgnoresFinalMethodsEvenIfTheirNameMatches PHP Метод

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

    public function matchesIgnoresFinalMethodsEvenIfTheirNameMatches()
    {
        $className = 'TestClass' . md5(uniqid(mt_rand(), true));
        eval('
			class ' . $className . ' {
				final public function someFinalMethod() {}
			}');
        $mockReflectionService = $this->getMockBuilder(ReflectionService::class)->disableOriginalConstructor()->setMethods(['isMethodFinal'])->getMock();
        $mockReflectionService->expects($this->atLeastOnce())->method('isMethodFinal')->with($className, 'someFinalMethod')->will($this->returnValue(true));
        $methodNameFilter = new Aop\Pointcut\PointcutMethodNameFilter('someFinalMethod');
        $methodNameFilter->injectReflectionService($mockReflectionService);
        $this->assertFalse($methodNameFilter->matches($className, 'someFinalMethod', $className, 1));
    }