Skip to content

Commit

Permalink
[Tests] fix issue with TableMap not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
jaugustin committed Jan 12, 2013
1 parent f35516b commit 8fa8df2
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -135,6 +135,10 @@ public function testBehaviors()
{ {
$bookTable = $this->databaseMap->getTableByPhpName('Propel\Tests\Bookstore\Book'); $bookTable = $this->databaseMap->getTableByPhpName('Propel\Tests\Bookstore\Book');
$this->assertEquals($bookTable->getBehaviors(), array(), 'getBehaviors() returns an empty array when no behaviors are registered'); $this->assertEquals($bookTable->getBehaviors(), array(), 'getBehaviors() returns an empty array when no behaviors are registered');

//this init tableMap for class 'Propel\Tests\Bookstore\Behavior\Table1'
Propel::getServiceContainer()->getDatabaseMap(Table1TableMap::DATABASE_NAME)->getTableByPhpName('Propel\Tests\Bookstore\Behavior\Table1');

$tmap = Propel::getServiceContainer()->getDatabaseMap(Table1TableMap::DATABASE_NAME)->getTable(Table1TableMap::TABLE_NAME); $tmap = Propel::getServiceContainer()->getDatabaseMap(Table1TableMap::DATABASE_NAME)->getTable(Table1TableMap::TABLE_NAME);
$expectedBehaviorParams = array('timestampable' => array('create_column' => 'created_on', 'update_column' => 'updated_on')); $expectedBehaviorParams = array('timestampable' => array('create_column' => 'created_on', 'update_column' => 'updated_on'));
$this->assertEquals($tmap->getBehaviors(), $expectedBehaviorParams, 'The map builder creates a getBehaviors() method to retrieve behaviors parameters when behaviors are registered'); $this->assertEquals($tmap->getBehaviors(), $expectedBehaviorParams, 'The map builder creates a getBehaviors() method to retrieve behaviors parameters when behaviors are registered');
Expand Down

0 comments on commit 8fa8df2

Please sign in to comment.