reduceTargetClassNames() public méthode

This method is used to optimize the matching process.
public reduceTargetClassNames ( ClassNameIndex $classNameIndex ) : ClassNameIndex
$classNameIndex Neos\Flow\Aop\Builder\ClassNameIndex
Résultat Neos\Flow\Aop\Builder\ClassNameIndex
 /**
  * @test
  */
 public function reduceTargetClassNamesFiltersAllClassesNotHavingTheGivenAnnotation()
 {
     $availableClassNames = ['TestPackage\\Subpackage\\Class1', 'TestPackage\\Class2', 'TestPackage\\Subpackage\\SubSubPackage\\Class3', 'TestPackage\\Subpackage2\\Class4'];
     sort($availableClassNames);
     $availableClassNamesIndex = new Aop\Builder\ClassNameIndex();
     $availableClassNamesIndex->setClassNames($availableClassNames);
     $mockReflectionService = $this->getMockBuilder(ReflectionService::class)->disableOriginalConstructor()->getMock();
     $mockReflectionService->expects($this->any())->method('getClassNamesByAnnotation')->with('SomeAnnotationClass')->will($this->returnValue(['TestPackage\\Subpackage\\Class1', 'TestPackage\\Subpackage\\SubSubPackage\\Class3', 'SomeMoreClass']));
     $classAnnotatedWithFilter = new Aop\Pointcut\PointcutClassAnnotatedWithFilter('SomeAnnotationClass');
     $classAnnotatedWithFilter->injectReflectionService($mockReflectionService);
     $expectedClassNames = ['TestPackage\\Subpackage\\Class1', 'TestPackage\\Subpackage\\SubSubPackage\\Class3'];
     sort($expectedClassNames);
     $expectedClassNamesIndex = new Aop\Builder\ClassNameIndex();
     $expectedClassNamesIndex->setClassNames($expectedClassNames);
     $result = $classAnnotatedWithFilter->reduceTargetClassNames($availableClassNamesIndex);
     $this->assertEquals($expectedClassNamesIndex, $result, 'The wrong class names have been filtered');
 }