/**
  * Ensures that entities are detached only once, which means that the same entity
  * is not detached again on the next flush() call.
  */
 public function testOnceDetachedEntitiesAreNotDetachedAgainOnNextFlush()
 {
     $this->objectManager->expects($this->exactly(2))->method('detach')->with($this->isInstanceOf('\\stdClass'));
     $this->decorator->persist(new \stdClass());
     $this->decorator->persist(new \stdClass());
     $this->decorator->flush();
     $this->decorator->flush();
 }