Skip to content

Commit

Permalink
Merge pull request #2490 from malarzm/2-5-test-matrix-changes
Browse files Browse the repository at this point in the history
Test against PHP 8.2 and MongoDB 6.0
  • Loading branch information
malarzm authored Dec 20, 2022
2 parents ef1222a + 4b0cb01 commit 632ad8e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/[email protected]"
with:
php-version: "8.1"
php-version: "8.2"
12 changes: 4 additions & 8 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
mongodb-version:
- "6.0"
- "5.0"
- "4.4"
- "4.2"
- "4.0"
driver-version:
- "stable"
topology:
Expand All @@ -34,11 +35,11 @@ jobs:
include:
- dependencies: "lowest"
php-version: "7.4"
mongodb-version: "3.6"
mongodb-version: "4.2"
driver-version: "1.5.0"
topology: "server"
- topology: "sharded_cluster"
php-version: "8.0"
php-version: "8.2"
mongodb-version: "4.4"
driver-version: "stable"
dependencies: "highest"
Expand Down Expand Up @@ -76,11 +77,6 @@ jobs:
- name: "Show driver information"
run: "php --ri mongodb"

# Remove this when laminas/laminas-code 4.5 is released
- name: "Use dev stability"
if: "${{ matrix.php-version == '8.1' }}"
run: composer config minimum-stability dev

# This allows installing symfony/console 3.4 and 6
- name: "Remove phpbench/phpbench"
run: composer remove --no-update --dev phpbench/phpbench
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,5 @@ jobs:
name: composer.lock
path: composer.lock

# https://github.com/doctrine/.github/issues/3
- name: "Run PHP_CodeSniffer"
- name: "Run PHPBench"
run: "vendor/bin/phpbench run --report=default --revs=100 --iterations=5 --report=aggregate"
28 changes: 0 additions & 28 deletions tests/Doctrine/ODM/MongoDB/Tests/Aggregation/Stage/LookupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,34 +278,6 @@ public function testLookupStageReferenceManyStoreAsRef(): void
self::assertSame('malarzm', $result[1]['users'][0]['username']);
}

public function testLookupStageReferenceManyWithoutUnwindMongoDB34(): void
{
$builder = $this->dm->createAggregationBuilder(SimpleReferenceUser::class);
$builder
->lookup('users')
->alias('users');

$expectedPipeline = [
[
'$lookup' => [
'from' => 'users',
'localField' => 'users',
'foreignField' => '_id',
'as' => 'users',
],
],
];

self::assertEquals($expectedPipeline, $builder->getPipeline());

$result = $builder->execute()->toArray();

self::assertCount(1, $result);
self::assertCount(2, $result[0]['users']);
self::assertSame('alcaeus', $result[0]['users'][0]['username']);
self::assertSame('malarzm', $result[0]['users'][1]['username']);
}

public function testLookupStageReferenceOneInverse(): void
{
$builder = $this->dm->createAggregationBuilder(User::class);
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/ODM/MongoDB/Tests/Functional/EnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use MongoDB\BSON\ObjectId;
use ValueError;

use function preg_quote;
use function sprintf;

/** @requires PHP >= 8.1 */
Expand Down Expand Up @@ -44,7 +45,7 @@ public function testLoadingInvalidBackingValueThrowsError(): void
$this->dm->getDocumentCollection(Card::class)->insertOne($document);

$this->expectException(ValueError::class);
$this->expectExceptionMessage(sprintf('"ABC" is not a valid backing value for enum "%s"', Suit::class));
$this->expectExceptionMessageMatches(sprintf('/^"ABC" is not a valid backing value for enum "?%s"?$/', preg_quote(Suit::class)));
$this->dm->getRepository(Card::class)->findOneBy([]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function testTest(): void

assert(isset($collection[0], $collection[1], $collection[2]));
// place element '0' after '1'
/** @var ArrayCollection<int, MODM29Embedded> $collection */
$collection = new ArrayCollection([
$collection[1],
$collection[0],
Expand Down

0 comments on commit 632ad8e

Please sign in to comment.