Skip to content

Commit

Permalink
Expand coverage for FloatType.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 7, 2015
1 parent b231727 commit ec311cf
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/TestCase/Database/Type/FloatTypeTest.php
Expand Up @@ -81,6 +81,12 @@ public function testToPHP()
*/
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);

Expand Down Expand Up @@ -143,6 +149,17 @@ public function testMarshalWithLocaleParsing()
$this->assertEquals($expected, $result);
}

/**
* 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.
*
Expand Down

0 comments on commit ec311cf

Please sign in to comment.