Answer the question
In order to leave comments, you need to log in
PHPUNIT expects not resetting between methods, how to win?
In setUp I create a class mock
protected function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
$this->importMock = $this->getMockBuilder(WriteoffsImportService::class)
->disableOriginalConstructor()->getMock();
}
$this->importMock->expects(self::once())->method('importWriteoffs');
Answer the question
In order to leave comments, you need to log in
reset after execution in the tearDown() method and/or use the globals-backup option
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question