Exemplo n.º 1
0
 public function testDraftInsert()
 {
     $car = new Car();
     $car->setLicensePlate('AB-123-C');
     $car->setSeats(5);
     $car->setDraft(true);
     $this->em->persist($car);
     $this->em->flush();
     $this->assertEquals(5, $car->getSeats(), "Draft entity state is changed after insert");
     $carId = $car->getId();
     $this->em->detach($car);
     // clear cache otherwise draftfilter wont do its work
     $this->assertNull($this->em->getRepository('Opifer\\Revisions\\Tests\\Entity\\Vehicle')->find($carId));
 }