コード例 #1
0
 /**
  * @expectedException PropelException
  */
 public function testModifyTableNoCopyDataKeepsAutoIncrement()
 {
     $content = new ConcreteContent();
     $content->save();
     $c = new Criteria();
     $c->add(ConcreteQuizzPeer::ID, $content->getId());
     ConcreteQuizzPeer::doInsert($c);
 }
 public function testGetChildObject()
 {
     ConcreteArticleQuery::create()->deleteAll();
     ConcreteQuizzQuery::create()->deleteAll();
     ConcreteContentQuery::create()->deleteAll();
     $content = new ConcreteContent();
     $content->save();
     $this->assertNull($content->getChildObject());
     $article = new ConcreteArticle();
     $article->save();
     $content = $article->getConcreteContent();
     $this->assertEquals($article, $content->getChildObject());
 }
コード例 #3
0
 public function testGetParentOrCreateExistingParent()
 {
     ConcreteContentQuery::create()->deleteAll();
     ConcreteArticleQuery::create()->deleteAll();
     $content = new ConcreteContent();
     $content->save();
     $id = $content->getId();
     ConcreteContentPeer::clearInstancePool();
     $article = new ConcreteArticle();
     $article->setId($id);
     $article->save();
     $this->assertEquals($id, $article->getId(), 'getParentOrCreate() keeps manually set pk');
     $this->assertEquals(1, ConcreteContentQuery::create()->count(), 'getParentOrCreate() creates no new parent entry');
 }