Skip to content

Commit 124e2af

Browse files
author
Malte Riesch
committed
replace one id column only
1 parent 4ff2438 commit 124e2af

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/TestDbAcle/Psv/Table/Meta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function isReplaceMode()
4040

4141
public function getIdentifyColumns()
4242
{
43-
return $this->getAttribute('identifiedBy', array());
43+
return (array) $this->getAttribute('identifiedBy', array());
4444
}
4545

4646
public function getTruncateDateColumns()

tests/TestDbAcle/Psv/Table/MetaTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public function test_Replace()
1818
$this->assertEquals(array('first_name','last_name'), $meta->getIdentifyColumns());
1919
}
2020

21+
public function test_Replace_OneIdColumn()
22+
{
23+
$meta = new \TestDbAcle\Psv\Table\Meta(array( 'mode'=> 'replace', 'identifiedBy' => 'id'));
24+
$this->assertTrue($meta->isReplaceMode());
25+
$this->assertEquals(array('id'), $meta->getIdentifyColumns());
26+
}
27+
2128
public function test_TruncateDates_none()
2229
{
2330
$meta = new \TestDbAcle\Psv\Table\Meta(array());

0 commit comments

Comments
 (0)