Browse Source

Try a larger value for the fractional tests.

Mark Story 6 years ago
parent
commit
75792dc8ed
2 changed files with 4 additions and 4 deletions
  1. 1 1
      tests/Fixture/DatatypesFixture.php
  2. 3 3
      tests/TestCase/ORM/QueryTest.php

+ 1 - 1
tests/Fixture/DatatypesFixture.php

@@ -27,7 +27,7 @@ class DatatypesFixture extends TestFixture
     public $fields = [
         'id' => ['type' => 'biginteger'],
         'cost' => ['type' => 'decimal', 'length' => 20, 'precision' => 1, 'null' => true],
-        'fraction' => ['type' => 'decimal', 'length' => 20, 'precision' => 19, 'null' => true],
+        'fraction' => ['type' => 'decimal', 'length' => 15, 'precision' => 14, 'null' => true],
         'floaty' => ['type' => 'float', 'null' => true],
         'small' => ['type' => 'smallinteger', 'null' => true],
         'tiny' => ['type' => 'tinyinteger', 'null' => true],

+ 3 - 3
tests/TestCase/ORM/QueryTest.php

@@ -3196,7 +3196,7 @@ class QueryTest extends TestCase
         $this->assertNotEmpty($out, 'Should get a record');
         $this->assertSame($big, $out->cost);
 
-        $small = '0.123456789012345';
+        $small = '0.12345678901234';
         $entity = $table->newEntity(['fraction' => $small]);
 
         $table->saveOrFail($entity);
@@ -3206,9 +3206,9 @@ class QueryTest extends TestCase
             ])
             ->first();
         $this->assertNotEmpty($out, 'Should get a record');
-        $this->assertRegExp('/^0?\.123456789012345/', $out->fraction);
+        $this->assertRegExp('/^0?\.12345678901234/', $out->fraction);
 
-        $small = 0.123456789012345;
+        $small = 0.12345678901234;
         $entity = $table->newEntity(['fraction' => $small]);
 
         $table->saveOrFail($entity);