processor = $this->createMock(MediaToMediaUnitProcessor::class); $this->subject = $this->getMockForAbstractClass(MediaToMediaRelationMigrationTask::class); $this->subject->setServiceLocator( $this->getServiceLocatorMock( [ MediaToMediaUnitProcessor::class => $this->processor, ] ) ); } public function testGetUnitProcessor(): void { $reflectionMethod = new ReflectionMethod($this->subject, 'getUnitProcessor'); $reflectionMethod->setAccessible(true); $this->assertSame($this->processor, $reflectionMethod->invoke($this->subject)); } }