Commit bcbdb0cd authored by Lee Davis's avatar Lee Davis Committed by Benjamin Eberlei

Update comparitor test to use assertCount

parent 43530584
...@@ -222,12 +222,12 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase ...@@ -222,12 +222,12 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$c = new Comparator(); $c = new Comparator();
$tableDiff = $c->diffTable($tableA, $tableB); $tableDiff = $c->diffTable($tableA, $tableB);
$this->assertEquals(1, count($tableDiff->renamedColumns), "we should have one rename datefield1 => new_datefield1."); $this->assertCount(1, $tableDiff->renamedColumns, "we should have one rename datefield1 => new_datefield1.");
$this->assertArrayHasKey('datefield1', $tableDiff->renamedColumns, "'datefield1' should be set to be renamed to new_datefield1"); $this->assertArrayHasKey('datefield1', $tableDiff->renamedColumns, "'datefield1' should be set to be renamed to new_datefield1");
$this->assertEquals(1, count($tableDiff->addedColumns), "'new_datefield2' should be added"); $this->assertCount(1, $tableDiff->addedColumns, "'new_datefield2' should be added");
$this->assertArrayHasKey('new_datefield2', $tableDiff->addedColumns, "'new_datefield2' should be added, not created through renaming!"); $this->assertArrayHasKey('new_datefield2', $tableDiff->addedColumns, "'new_datefield2' should be added, not created through renaming!");
$this->assertEquals(0, count($tableDiff->removedColumns), "Nothing should be removed."); $this->assertCount(0, $tableDiff->removedColumns, "Nothing should be removed.");
$this->assertEquals(0, count($tableDiff->changedColumns), "Nothing should be changed as all fields old & new have diff names."); $this->assertCount(0, $tableDiff->changedColumns, "Nothing should be changed as all fields old & new have diff names.");
} }
public function testCompareRemovedIndex() public function testCompareRemovedIndex()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment