mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding tests and support for binary columns in model task. Fixes #241
This commit is contained in:
parent
e609875754
commit
b4f6dd9c6e
2 changed files with 5 additions and 2 deletions
|
@ -870,6 +870,7 @@ class ModelTask extends Shell {
|
|||
case 'integer':
|
||||
$insert = 1;
|
||||
break;
|
||||
case 'binary':
|
||||
case 'string';
|
||||
$insert = "Lorem ipsum dolor sit amet";
|
||||
if (!empty($value['length'])) {
|
||||
|
|
|
@ -53,7 +53,7 @@ Mock::generatePartial(
|
|||
* @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 @@ class ModelTaskTest extends CakeTestCase {
|
|||
$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);
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Reference in a new issue