-
-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test against PHP 8.2 and MongoDB 6.0 #2490
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ jobs: | |
name: "Coding Standards" | ||
uses: "doctrine/.github/.github/workflows/[email protected]" | ||
with: | ||
php-version: "8.1" | ||
php-version: "8.2" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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" | ||
|
@@ -76,11 +77,6 @@ jobs: | |
- name: "Show driver information" | ||
run: "php --ri mongodb" | ||
|
||
# Remove this when laminas/laminas-code 4.5 is released | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it has been ;) |
||
- 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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,34 +278,6 @@ public function testLookupStageReferenceManyStoreAsRef(): void | |
self::assertSame('malarzm', $result[1]['users'][0]['username']); | ||
} | ||
|
||
public function testLookupStageReferenceManyWithoutUnwindMongoDB34(): void | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test started failing with MongoDB 6.0. Given is was written specifically for 3.4 it's ok to get rid of it |
||
{ | ||
$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); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
use MongoDB\BSON\ObjectId; | ||
use ValueError; | ||
|
||
use function preg_quote; | ||
use function sprintf; | ||
|
||
/** @requires PHP >= 8.1 */ | ||
|
@@ -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))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quotes are gone in 8.2 |
||
$this->dm->getRepository(Card::class)->findOneBy([]); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This suddenly made Psalm fail |
||
$collection = new ArrayCollection([ | ||
$collection[1], | ||
$collection[0], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4.0 has reached end of life in April 2022, no need to test against it. 4.2 will be gone in April 2023 by the way