createMock(TopLevelPreprocessor::class); $topLevel->expects($this->once())->method('preprocess')->willReturn([]); $secondPreprocessor = $this->createMock(TopLevelPreprocessor::class); $secondPreprocessor->expects($this->once())->method('preprocess')->willReturn([]); $preprocessManager = new PreprocessManager($topLevel); $preprocessManager->registerPreprocessor($secondPreprocessor); expect($preprocessManager->preprocess([]))->equals([]); } }