Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating tests to expand coverage of buildcolumn.

  • Loading branch information...
commit aa03756238ec45b47cce5163bf7bb84bf131b623 1 parent 2383154
@markstory markstory authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 cake/tests/cases/libs/model/datasources/dbo_source.test.php
View
10 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);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.