|
|
|
@ -466,7 +466,8 @@ class SimplePdoTest extends TestCase
|
|
|
|
public function testFetchFieldReturnsFirstColumn(): void
|
|
|
|
public function testFetchFieldReturnsFirstColumn(): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$id = $this->db->fetchField('SELECT id, name FROM users WHERE id = ?', [1]);
|
|
|
|
$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
|
|
|
|
public function testFetchFieldReturnsFalseWhenNoResults(): void
|
|
|
|
@ -485,7 +486,8 @@ class SimplePdoTest extends TestCase
|
|
|
|
public function testFetchFieldReturnsZero(): void
|
|
|
|
public function testFetchFieldReturnsZero(): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$value = $this->db->fetchField('SELECT 0');
|
|
|
|
$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
|
|
|
|
public function testFetchFieldReturnsEmptyString(): void
|
|
|
|
|