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

This commit is contained in:
mark_story 2009-11-04 22:57:43 -05:00
parent e609875754
commit b4f6dd9c6e
2 changed files with 5 additions and 2 deletions

View file

@ -870,6 +870,7 @@ class ModelTask extends Shell {
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'])) {

View file

@ -53,7 +53,7 @@ Mock::generatePartial(
* @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
* *
@ -85,6 +85,8 @@ class ModelTaskTest extends CakeTestCase {
$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);
} }
} }
?> ?>