Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding mappings appends to, and does not overrides existing ones

  • Loading branch information...
commit c4eb380fc3fac7d0d1a8b067dac08f88884799bd 1 parent c49743b
Marcello Duarte authored

Showing 1 changed file with 21 additions and 0 deletions. Show diff stats Hide diff stats

  1. +21 0 tests/lib/Phabric/Datasource/ZendTest.php
21 tests/lib/Phabric/Datasource/ZendTest.php
@@ -95,6 +95,27 @@ public function testSetTableMappingsOvveridesExistingMappings()
95 95 $this->assertEquals($expected, $this->object->getMappings());
96 96 }
97 97
  98 + public function testAddMappingsAppendsNotOverrides()
  99 + {
  100 + $this->object->addTableMapping('event', 't_event', 'id', 'name');
  101 + $this->object->addTableMapping('session', 't_session', 'id', 'name');
  102 +
  103 + $expected = array(
  104 + 'event' => array(
  105 + 'tableName' => 't_event',
  106 + 'primaryKey' => 'id',
  107 + 'nameCol' => 'name'
  108 + ),
  109 + 'session' => array(
  110 + 'tableName' => 't_session',
  111 + 'primaryKey' => 'id',
  112 + 'nameCol' => 'name'
  113 + )
  114 + );
  115 +
  116 + $this->assertEquals($expected, $this->object->getMappings());
  117 + }
  118 +
98 119 public function testInsert()
99 120 {
100 121 $mEntity = m::mock('\Phabric\Entity');

0 comments on commit c4eb380

Please sign in to comment.
Something went wrong with that request. Please try again.