Skip to content

Commit

Permalink
Adding tests and support for binary columns in model task. Fixes #241
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 5, 2009
1 parent e609875 commit b4f6dd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions cake/console/libs/tasks/model.php
Expand Up @@ -870,6 +870,7 @@ function fixture($model, $useTable = null) {
case 'integer': case 'integer':
$insert = 1; $insert = 1;
break; break;
case 'binary':
case 'string'; case 'string';
$insert = "Lorem ipsum dolor sit amet"; $insert = "Lorem ipsum dolor sit amet";
if (!empty($value['length'])) { if (!empty($value['length'])) {
Expand Down
6 changes: 4 additions & 2 deletions cake/tests/cases/console/libs/tasks/model.test.php
Expand Up @@ -53,7 +53,7 @@
* @subpackage cake.tests.cases.console.libs.tasks * @subpackage cake.tests.cases.console.libs.tasks
*/ */
class ModelTaskTest extends CakeTestCase { class ModelTaskTest extends CakeTestCase {
var $fixtures = array('core.datatype'); var $fixtures = array('core.datatype', 'core.binary_test');
/** /**
* setUp method * setUp method
* *
Expand Down Expand Up @@ -84,7 +84,9 @@ function testFixtureGeneration() {
$this->Task->setReturnValue('createFile', true); $this->Task->setReturnValue('createFile', true);
$result = $this->Task->fixture('Datatype'); $result = $this->Task->fixture('Datatype');
$this->assertPattern('/float_field\' => 1/', $result); $this->assertPattern('/float_field\' => 1/', $result);


$result = $this->Task->fixture('BinaryTest');
$this->assertPattern("/'data' => 'Lorem ipsum dolor sit amet'/", $result);
} }
} }
?> ?>

0 comments on commit b4f6dd9

Please sign in to comment.