Skip to content
Permalink
Browse files

Updating tests to expand coverage of buildcolumn.

  • Loading branch information...
markstory committed Oct 29, 2009
1 parent 2383154 commit aa03756238ec45b47cce5163bf7bb84bf131b623
Showing with 5 additions and 5 deletions.
  1. +5 −5 cake/tests/cases/libs/model/datasources/dbo_source.test.php
@@ -3591,16 +3591,16 @@ function testBuildColumn() {
);
$this->testDb->buildColumn($data);
$this->testDb->columns = array('varchar(255)' => 1);
$data = array(
'name' => 'testName',
'type' => 'varchar(255)',
'type' => 'string',
'length' => 255,
'default',
'null' => true,
'key'
);
$result = $this->testDb->buildColumn($data);
$expected = '`testName` DEFAULT NULL';
$expected = '`testName` varchar(255) DEFAULT NULL';
$this->assertEqual($result, $expected);
$data = array(
@@ -3653,11 +3653,11 @@ function testBuildColumn() {
function testHasAny() {
$this->testDb->hasAny($this->Model, array());
$expected = 'SELECT COUNT(`TestModel`.`id`) AS count FROM `test_models` AS `TestModel` WHERE 1 = 1';
$this->assertEqual($this->testDb->simulated[1], $expected);
$this->assertEqual(end($this->testDb->simulated), $expected);
$this->testDb->hasAny($this->Model, array('TestModel.name' => 'harry'));
$expected = "SELECT COUNT(`TestModel`.`id`) AS count FROM `test_models` AS `TestModel` WHERE `TestModel`.`name` = 'harry'";
$this->assertEqual($this->testDb->simulated[2], $expected);
$this->assertEqual(end($this->testDb->simulated), $expected);
}
/**

0 comments on commit aa03756

Please sign in to comment.
You can’t perform that action at this time.