/** * Tests the overriding reloadOnInsert at runtime. * * @link http://trac.propelorm.org/ticket/378 * @link http://trac.propelorm.org/ticket/555 */ public function testDefaultExpresions_ReloadOnInsert_Override() { if (Propel::getDb(BookstoreEmployeePeer::DATABASE_NAME) instanceof DBSqlite) { $this->markTestSkipped("Cannot test default date expressions with SQLite"); } // Create a new bookstore, contest, bookstore_contest, and bookstore_contest_entry $b = new Bookstore(); $b->setStoreName("Barnes & Noble"); $b->save(); $c = new Contest(); $c->setName("Bookathon Contest"); $c->save(); $bc = new BookstoreContest(); $bc->setBookstore($b); $bc->setContest($c); $bc->save(); $c = new Customer(); $c->setName("Happy Customer"); $c->save(); $bce = new BookstoreContestEntry(); $bce->setBookstore($b); $bce->setBookstoreContest($bc); $bce->setCustomer($c); $bce->save(null, $skipReload = true); $this->assertNull($bce->getEntryDate(), "Expected a NULL entry_date after save."); }
/** * Test behavior of columns that are implicated in multiple foreign keys. * @link http://propel.phpdb.org/trac/ticket/228 */ public function testMultiFkImplication() { BookstoreDataPopulator::populate(); // Create a new bookstore, contest, bookstore_contest, and bookstore_contest_entry $b = new Bookstore(); $b->setStoreName("Foo!"); $b->save(); $c = new Contest(); $c->setName("Bookathon Contest"); $c->save(); $bc = new BookstoreContest(); $bc->setBookstore($b); $bc->setContest($c); $bc->save(); $c = new Customer(); $c->setName("Happy Customer"); $c->save(); $bce = new BookstoreContestEntry(); $bce->setBookstore($b); $bce->setBookstoreContest($bc); $bce->setCustomer($c); $bce->save(); $bce->setBookstoreId(null); $this->assertNull($bce->getBookstoreContest()); $this->assertNull($bce->getBookstore()); }