Skip to content

Commit e104b78

Browse files
committed
pack not needed, fixed in latest phpunit 8.5/9.5
1 parent 60ea1a7 commit e104b78

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/TypecastingTest.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,12 @@ public function testType(): void
112112
$this->assertEquals($first, $duplicate);
113113

114114
$m->load(2)->set('float', 8.20234376757474)->save();
115-
// pack is needed to compare float numbers exactly, see https://github.com/sebastianbergmann/phpunit/issues/4966
116-
// remove bin2hex/pack once phpunit is fixed officially
117-
$this->assertSame(bin2hex(pack('e', 8.20234376757474)), bin2hex(pack('e', $m->load(2)->get('float'))));
115+
$this->assertSame(8.20234376757474, $m->load(2)->get('float'));
118116
$m->load(2)->set('float', 8.202343767574732)->save();
119-
// pdo_sqlite in truncating float when converted to string, see https://github.com/php/php-src/issues/8510
117+
// pdo_sqlite in truncating float, see https://github.com/php/php-src/issues/8510
120118
// fixed since PHP 8.1, but if converted in SQL to string explicitly, the result is still wrong
121119
if (!$this->getDatabasePlatform() instanceof SqlitePlatform || \PHP_VERSION_ID >= 81000) {
122-
$this->assertSame(bin2hex(pack('e', 8.202343767574732)), bin2hex(pack('e', $m->load(2)->get('float'))));
120+
$this->assertSame(8.202343767574732, $m->load(2)->get('float'));
123121
}
124122
}
125123

0 commit comments

Comments
 (0)