问题描述:

I would like to test a method that just call a method of my entity object and persists it to the database.

public function setNameAndPersistObject($entityObject) {

$entityObject->setName("John");

$this->entityManager->persist($entityObject);

}

Both $entityObject and $entityManager are mocks, not actual objects.

I would like to test the call order of the called methods, to test that 'persist' gets called after 'setName', so the new name "John" gets saved in the database. How would I do that in PHPUnit?

相关阅读:
Top