Skip to content

Commit

Permalink
Add PHP 8.1 to CI
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander M. Turek <me@derrabus.de>
  • Loading branch information
derrabus committed Sep 28, 2021
1 parent 5326736 commit f73f831
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"

steps:
- name: "Checkout"
Expand All @@ -34,6 +35,10 @@ jobs:
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: "Switch to dev dependencies"
if: "${{ matrix.php-version == '8.1' }}"
run: "composer config minimum-stability dev"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"

Expand Down
6 changes: 4 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH7941Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public function typesShouldBeConvertedForDQLFunctions(): void
$result = $query->getSingleResult();

self::assertSame(6, $result['count']);
self::assertSame('325', $result['sales']);

// While other drivers will return a string, pdo_sqlite returns an integer as of PHP 8.1
self::assertEquals(325, $result['sales']);

// Driver return type and precision is determined by the underlying php extension, most seem to return a string.
// pdo_mysql and mysqli both currently return '54.1667' so this is the maximum precision we can assert.
Expand All @@ -68,7 +70,7 @@ public function typesShouldBeConvertedForDQLFunctions(): void
foreach ($query->getResult() as $i => $item) {
$product = self::PRODUCTS[$i];

self::assertSame(ltrim($product['price'], '-'), $item['absolute']);
self::assertEquals(ltrim($product['price'], '-'), $item['absolute']);
self::assertSame(strlen($product['name']), $item['length']);

// Driver return types for the `square_root` column are inconsistent depending on the underlying
Expand Down

0 comments on commit f73f831

Please sign in to comment.