Skip to content

Commit

Permalink
Float adjustment to work with fixed float rounding in PHP 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
asgrim committed Dec 3, 2016
1 parent 73fb9c5 commit 106388a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/unit/Reflection/ReflectionParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ public function defaultValueStringProvider()
{
return [
['123', '123'],
['12.3', '12.300000000000001'], // Oh, yes, because PHP.
['12.3', '12.3'],
['true', 'true'],
['false', 'false'],
['null', 'NULL'],
Expand All @@ -515,7 +515,8 @@ public function testGetDefaultValueAsString($defaultValue, $expectedValue)
$functionInfo = $reflector->reflect('myMethod');
$paramInfo = $functionInfo->getParameter('var');

$this->assertSame($expectedValue, $paramInfo->getDefaultValueAsString());
// Must be starts with because PHP (sometimes value is 12.300000000000001)
$this->assertStringStartsWith($expectedValue, $paramInfo->getDefaultValueAsString());
}

public function testGetClassForTypeHintedMethodParameters()
Expand Down

0 comments on commit 106388a

Please sign in to comment.