Skip to content
Permalink
Browse files

Add default value generation for all integer types.

This resolves the bigint issue raised by @chinpei in 10347 and adds
default values for the new small & tiny integer types.
  • Loading branch information...
markstory committed Mar 12, 2017
1 parent b6372d6 commit c3f88c350e400134b0f551149f31b8d315dfd560
@@ -335,6 +335,9 @@ protected function _generateRecords($tableInfo, $recordCount = 1) {
}
$insert = '';
switch ($fieldInfo['type']) {
case 'tinyinteger':
case 'smallinteger':
case 'biginteger':
case 'integer':
case 'float':
$insert = $i + 1;
@@ -470,17 +470,20 @@ public function testBake() {
}
/**
* test record generation with float and binary types
* test record generation with various integer, float and binary types
*
* @return void
*/
public function testRecordGenerationForBinaryAndFloat() {
public function testRecordGenerationForBinaryFloatAndIntegerTypes() {
$this->Task->connection = 'test';
$this->Task->path = '/my/path/';
$result = $this->Task->bake('Article', 'datatypes');
$this->assertContains("'float_field' => 1", $result);
$this->assertContains("'bool' => 1", $result);
$this->assertContains("'tiny_int' => 1", $result);
$this->assertContains("'small_int' => 1", $result);
$this->assertContains("'huge_int' => 1", $result);
$result = $this->Task->bake('Article', 'binary_tests');
$this->assertContains("'data' => 'Lorem ipsum dolor sit amet'", $result);

0 comments on commit c3f88c3

Please sign in to comment.
You can’t perform that action at this time.