objectPersister = $this->getMockBuilder(ObjectPersister::class)->disableOriginalConstructor()->getMock(); } /** * @see EducationNotationUpdater::update() */ public function testUpdate(): void { $educationNotationUpdater = $this->getMockBuilder(TestableEducationNotationUpdater::class) ->setConstructorArgs([$this->objectPersister]) ->setMethodsExcept(['update']) ->getMock(); $educationNotations = ['foo']; $this->objectPersister->expects(self::once())->method('replaceMany')->with($educationNotations); $educationNotationUpdater->update($educationNotations); } }