Browse files

Adding tests and support for binary columns in model task. Fixes #241

  • Loading branch information...
1 parent e609875 commit b4f6dd9c6e304164c8b0fc64d29d7de82617c23e @markstory markstory committed Nov 4, 2009
Showing with 5 additions and 2 deletions.
  1. +1 −0 cake/console/libs/tasks/model.php
  2. +4 −2 cake/tests/cases/console/libs/tasks/model.test.php
View
1 cake/console/libs/tasks/model.php
@@ -870,6 +870,7 @@ function fixture($model, $useTable = null) {
case 'integer':
$insert = 1;
break;
+ case 'binary':
case 'string';
$insert = "Lorem ipsum dolor sit amet";
if (!empty($value['length'])) {
View
6 cake/tests/cases/console/libs/tasks/model.test.php
@@ -53,7 +53,7 @@
* @subpackage cake.tests.cases.console.libs.tasks
*/
class ModelTaskTest extends CakeTestCase {
- var $fixtures = array('core.datatype');
+ var $fixtures = array('core.datatype', 'core.binary_test');
/**
* setUp method
*
@@ -84,7 +84,9 @@ function testFixtureGeneration() {
$this->Task->setReturnValue('createFile', true);
$result = $this->Task->fixture('Datatype');
$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.