Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding mappings appends to, and does not overrides existing ones

  • Loading branch information...
commit c4eb380fc3fac7d0d1a8b067dac08f88884799bd 1 parent c49743b
Marcello Duarte authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/lib/Phabric/Datasource/ZendTest.php
21 tests/lib/Phabric/Datasource/ZendTest.php
View
@@ -95,6 +95,27 @@ public function testSetTableMappingsOvveridesExistingMappings()
$this->assertEquals($expected, $this->object->getMappings());
}
+ public function testAddMappingsAppendsNotOverrides()
+ {
+ $this->object->addTableMapping('event', 't_event', 'id', 'name');
+ $this->object->addTableMapping('session', 't_session', 'id', 'name');
+
+ $expected = array(
+ 'event' => array(
+ 'tableName' => 't_event',
+ 'primaryKey' => 'id',
+ 'nameCol' => 'name'
+ ),
+ 'session' => array(
+ 'tableName' => 't_session',
+ 'primaryKey' => 'id',
+ 'nameCol' => 'name'
+ )
+ );
+
+ $this->assertEquals($expected, $this->object->getMappings());
+ }
+
public function testInsert()
{
$mEntity = m::mock('\Phabric\Entity');
Please sign in to comment.
Something went wrong with that request. Please try again.