matches() public method

Returns TRUE if method name, visibility and arguments constraints match and the target method is not final.
public matches ( string $className, string $methodName, string $methodDeclaringClassName, mixed $pointcutQueryIdentifier ) : boolean
$className string Ignored in this pointcut filter
$methodName string Name of the method to match against
$methodDeclaringClassName string Name of the class the method was originally declared in
$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
    /**
     * @test
     */
    public function matchesChecksTheAvailablityOfAnArgumentNameIfArgumentConstraintsHaveBeenConfigured()
    {
        $className = 'TestClass' . md5(uniqid(mt_rand(), true));
        eval('
			class ' . $className . " {\n\t\t\t\tpublic function somePublicMethod(\$arg1) {}\n\t\t\t\tpublic function someOtherPublicMethod(\$arg1, \$arg2 = 'default') {}\n\t\t\t\tpublic function someThirdMethod(\$arg1, \$arg2, \$arg3 = 'default') {}\n\t\t\t}");
        $mockReflectionService = $this->createMock(ReflectionService::class);
        $mockReflectionService->expects($this->exactly(3))->method('getMethodParameters')->will($this->onConsecutiveCalls(['arg1' => []], ['arg1' => [], 'arg2' => []], ['arg1' => [], 'arg2' => [], 'arg3' => []]));
        $mockSystemLogger = $this->getMockBuilder(\Neos\Flow\Log\Logger::class)->setMethods(['log'])->getMock();
        $mockSystemLogger->expects($this->once())->method('log')->with($this->equalTo('The argument "arg2" declared in pointcut does not exist in method ' . $className . '->somePublicMethod'));
        $argumentConstraints = ['arg1' => ['operator' => '==', 'value' => 'someValue'], 'arg2.some.sub.object' => ['operator' => '==', 'value' => 'someValue']];
        $methodNameFilter = new Aop\Pointcut\PointcutMethodNameFilter('some.*', null, $argumentConstraints);
        $methodNameFilter->injectReflectionService($mockReflectionService);
        $methodNameFilter->injectSystemLogger($mockSystemLogger);
        $methodNameFilter->matches(__CLASS__, 'somePublicMethod', $className, 1);
        $this->assertTrue($methodNameFilter->matches(__CLASS__, 'someOtherPublicMethod', $className, 1));
        $this->assertTrue($methodNameFilter->matches(__CLASS__, 'someThirdMethod', $className, 1));
    }