diff --git a/tests/PdoWrapperTest.php b/tests/PdoWrapperTest.php index d3a2928..132156b 100644 --- a/tests/PdoWrapperTest.php +++ b/tests/PdoWrapperTest.php @@ -68,7 +68,8 @@ class PdoWrapperTest extends TestCase public function testFetchField(): void { $id = $this->pdo_wrapper->fetchField('SELECT id FROM test WHERE name = ?', ['two']); - $this->assertSame(2, $id); + // PDO SQLite may return numeric strings on PHP < 8.1 + $this->assertEquals(2, $id); } public function testFetchFieldReturnsFalseWhenNoResults(): void @@ -87,7 +88,8 @@ class PdoWrapperTest extends TestCase public function testFetchFieldReturnsZero(): void { $value = $this->pdo_wrapper->fetchField('SELECT 0'); - $this->assertSame(0, $value); + // PDO SQLite may return '0' on PHP < 8.1 + $this->assertEquals(0, $value); } public function testFetchFieldReturnsEmptyString(): void diff --git a/tests/SimplePdoTest.php b/tests/SimplePdoTest.php index c4441af..0143381 100644 --- a/tests/SimplePdoTest.php +++ b/tests/SimplePdoTest.php @@ -466,7 +466,8 @@ class SimplePdoTest extends TestCase public function testFetchFieldReturnsFirstColumn(): void { $id = $this->db->fetchField('SELECT id, name FROM users WHERE id = ?', [1]); - $this->assertSame(1, $id); + // PDO SQLite may return numeric strings on PHP < 8.1 + $this->assertEquals(1, $id); } public function testFetchFieldReturnsFalseWhenNoResults(): void @@ -485,7 +486,8 @@ class SimplePdoTest extends TestCase public function testFetchFieldReturnsZero(): void { $value = $this->db->fetchField('SELECT 0'); - $this->assertSame(0, $value); + // PDO SQLite may return '0' on PHP < 8.1 + $this->assertEquals(0, $value); } public function testFetchFieldReturnsEmptyString(): void