コード例 #1
0
 public function testCanPersistModel()
 {
     $model = new DummyEntity();
     $this->assertNull($model->getId());
     $this->entityManager->persist($model);
     $this->entityManager->flush();
     $this->assertNotNull($model->getId());
 }
コード例 #2
0
 public function testCanPersist()
 {
     $em = $this->getEntityManager(array(__DIR__ . '/TestAssets/metadata'));
     $this->createSchema($em);
     $this->assertNull($this->model->getId());
     $em->persist($this->model);
     $em->flush();
     $this->assertNotNull($this->model->getId());
 }