Browse Source

Expand coverage for FloatType.

Mark Story 10 years ago
parent
commit
ec311cf9f6
1 changed files with 17 additions and 0 deletions
  1. 17 0
      tests/TestCase/Database/Type/FloatTypeTest.php

+ 17 - 0
tests/TestCase/Database/Type/FloatTypeTest.php

@@ -81,6 +81,12 @@ class FloatTypeTest extends TestCase
      */
     public function testToDatabase()
     {
+        $result = $this->type->toDatabase('', $this->driver);
+        $this->assertNull($result);
+
+        $result = $this->type->toDatabase(null, $this->driver);
+        $this->assertNull($result);
+
         $result = $this->type->toDatabase('some data', $this->driver);
         $this->assertSame(0.0, $result);
 
@@ -144,6 +150,17 @@ class FloatTypeTest extends TestCase
     }
 
     /**
+     * Test that exceptions are raised on invalid parsers.
+     *
+     * @expectedException RuntimeException
+     * @return void
+     */
+    public function testUseLocaleParsingInvalid()
+    {
+        $this->type->useLocaleParser('stdClass');
+    }
+
+    /**
      * Test that the PDO binding type is correct.
      *
      * @return void