forked from rectorphp/rector-phpunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixture.php.inc
47 lines (39 loc) · 1.34 KB
/
fixture.php.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace Rector\PHPUnit\Tests\Transform\Rector\AssertEqualsOrAssertSameFloatParameterToSpecificMethodsTypeRector\Fixture;
use PHPUnit\Framework\TestCase;
class MyTest1 extends TestCase
{
public function test()
{
$value = 10.20001;
$this->assertSame(10.20, $value);
$this->assertEquals(10.20, $value);
$this->assertEquals(10.200, $value);
$this->assertEquals('10.20', $value);
$this->assertSame(10.28, $value);
$this->assertEquals(10.2, $value);
$this->assertEquals(10, $value);
$this->assertSame(10, $value);
}
}
?>
-----
<?php
namespace Rector\PHPUnit\Tests\Transform\Rector\AssertEqualsOrAssertSameFloatParameterToSpecificMethodsTypeRector\Fixture;
use PHPUnit\Framework\TestCase;
class MyTest1 extends TestCase
{
public function test()
{
$value = 10.20001;
$this->assertEqualsWithDelta(10.20, $value, PHP_FLOAT_EPSILON);
$this->assertEqualsWithDelta(10.20, $value, PHP_FLOAT_EPSILON);
$this->assertEqualsWithDelta(10.200, $value, PHP_FLOAT_EPSILON);
$this->assertEquals('10.20', $value);
$this->assertEqualsWithDelta(10.28, $value, PHP_FLOAT_EPSILON);
$this->assertEqualsWithDelta(10.2, $value, PHP_FLOAT_EPSILON);
$this->assertEquals(10, $value);
$this->assertSame(10, $value);
}
}
?>