Skip to content

Commit

Permalink
Update test for a change in behavior
Browse files Browse the repository at this point in the history
By default PDO now uses native types for int/floats instead of everything being strings.
  • Loading branch information
srjlewis authored Nov 3, 2021
1 parent 4eb418b commit 2eb4485
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ExtendedPdoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ public function testFetchObject()
$actual = $this->pdo->fetchObject($stm, [1]);

// in php <= 8 id is a string, in php >= 8.1 it is a int
$this->assertSame('1', (string)$actual->id);
// https://github.com/php/php-src/blob/PHP-8.1/UPGRADING#L131
$this->assertSame(1, $actual->id);
$this->assertSame('Anna', $actual->name);
}

Expand All @@ -313,7 +314,8 @@ public function testFetchObject_withCtorArgs()
['bar']
);
// in php <= 8 id is a string, in php >= 8.1 it is a int
$this->assertSame('1', (string)$actual->id);
// https://github.com/php/php-src/blob/PHP-8.1/UPGRADING#L131
$this->assertSame(1, $actual->id);
$this->assertSame('Anna', $actual->name);
$this->assertSame('bar', $actual->foo);
}
Expand Down

0 comments on commit 2eb4485

Please sign in to comment.