injectReflectionService() public method

Injects the reflection service
public injectReflectionService ( ReflectionService $reflectionService ) : void
$reflectionService Neos\Flow\Reflection\ReflectionService The reflection service
return void
 /**
  * @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');
 }
 /**
  * Takes a class annotation filter pattern and adds a so configured class annotation filter to the
  * filter composite object.
  *
  * @param string $operator The operator
  * @param string $annotationPattern The pattern expression as configuration for the class annotation filter
  * @param PointcutFilterComposite $pointcutFilterComposite An instance of the pointcut filter composite. The result (ie. the class annotation filter) will be added to this composite object.
  * @return void
  */
 protected function parseDesignatorClassAnnotatedWith($operator, $annotationPattern, PointcutFilterComposite $pointcutFilterComposite)
 {
     $annotationPropertyConstraints = [];
     $this->parseAnnotationPattern($annotationPattern, $annotationPropertyConstraints);
     $filter = new PointcutClassAnnotatedWithFilter($annotationPattern, $annotationPropertyConstraints);
     $filter->injectReflectionService($this->reflectionService);
     $filter->injectSystemLogger($this->objectManager->get(SystemLoggerInterface::class));
     $pointcutFilterComposite->addFilter($operator, $filter);
 }