Skip to content

Commit 883cf30

Browse files
committed
Merge branch '2.18.x' into 3.2.x
# Conflicts: # .github/workflows/static-analysis.yml # composer.json # tests/Middleware/IdleConnectionMiddlewareTest.php
2 parents 038bd78 + 6316ebc commit 883cf30

13 files changed

Lines changed: 212 additions & 11 deletions

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ on:
2626
jobs:
2727
coding-standards:
2828
name: "Coding Standards"
29-
uses: "doctrine/.github/.github/workflows/coding-standards.yml@15.0.0"
29+
uses: "doctrine/.github/.github/workflows/coding-standards.yml@15.1.0"
3030
with:
3131
composer-options: "--prefer-dist --prefer-stable"

.github/workflows/composer-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ on:
1717
jobs:
1818
composer-lint:
1919
name: "Composer Lint"
20-
uses: "doctrine/.github/.github/workflows/composer-lint.yml@15.0.0"
20+
uses: "doctrine/.github/.github/workflows/composer-lint.yml@15.1.0"

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595

9696
steps:
9797
- name: "Checkout"
98-
uses: "actions/checkout@v6"
98+
uses: "actions/checkout@v7"
9999
with:
100100
fetch-depth: 2
101101

@@ -145,7 +145,7 @@ jobs:
145145

146146
steps:
147147
- name: "Checkout"
148-
uses: "actions/checkout@v6"
148+
uses: "actions/checkout@v7"
149149
with:
150150
fetch-depth: 2
151151

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ on:
1717
jobs:
1818
documentation:
1919
name: "Documentation"
20-
uses: "doctrine/.github/.github/workflows/documentation.yml@15.0.0"
20+
uses: "doctrine/.github/.github/workflows/documentation.yml@15.1.0"

.github/workflows/release-on-milestone-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
release:
1010
name: "Git tag, release & create merge-up PR"
11-
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@15.0.0"
11+
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@15.1.0"
1212
secrets:
1313
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
1414
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
- tests/**
2525

2626
jobs:
27-
phpstan:
27+
static-analysis:
2828
name: "PHPStan"
2929
runs-on: "ubuntu-latest"
3030

.github/workflows/test-dev-stability.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: "Checkout"
30-
uses: "actions/checkout@v6"
30+
uses: "actions/checkout@v7"
3131
with:
3232
fetch-depth: 2
3333

.github/workflows/website-schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ on:
1818
jobs:
1919
json-validate:
2020
name: "Validate JSON schema"
21-
uses: "doctrine/.github/.github/workflows/website-schema.yml@15.0.0"
21+
uses: "doctrine/.github/.github/workflows/website-schema.yml@15.1.0"

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@
5353
"phpunit/phpunit": "^12.3.10",
5454
"psr/log": "^3.0",
5555
"symfony/doctrine-messenger": "^6.4 || ^7.0 || ^8.0",
56+
"symfony/event-dispatcher": "^6.4 || ^7.0",
5657
"symfony/expression-language": "^6.4 || ^7.0 || ^8.0",
5758
"symfony/http-kernel": "^6.4 || ^7.0 || ^8.0",
5859
"symfony/messenger": "^6.4 || ^7.0 || ^8.0",
59-
"symfony/property-info": "^6.4 || ^7.0 || ^8.0",
60+
"symfony/property-info": "^6.4 || ^7.0",
61+
"symfony/runtime": "^6.4 || ^7.0 || ^8.0",
6062
"symfony/security-bundle": "^6.4 || ^7.0 || ^8.0",
6163
"symfony/stopwatch": "^6.4 || ^7.0 || ^8.0",
6264
"symfony/string": "^6.4 || ^7.0 || ^8.0",
@@ -91,7 +93,8 @@
9193
"allow-plugins": {
9294
"composer/package-versions-deprecated": true,
9395
"dealerdirect/phpcodesniffer-composer-installer": true,
94-
"symfony/flex": true
96+
"symfony/flex": true,
97+
"symfony/runtime": false
9598
},
9699
"sort-packages": true
97100
},
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Doctrine\Bundle\DoctrineBundle\Tests\ArgumentResolver;
6+
7+
use Doctrine\Bundle\DoctrineBundle\Tests\ArgumentResolver\Fixtures\EntityValueResolverFunctionalKernel;
8+
use Doctrine\Bundle\DoctrineBundle\Tests\ArgumentResolver\Fixtures\Post;
9+
use Doctrine\ORM\EntityManagerInterface;
10+
use PHPUnit\Framework\TestCase;
11+
use Symfony\Component\HttpFoundation\Request;
12+
13+
use function interface_exists;
14+
use function json_decode;
15+
16+
/**
17+
* Regression coverage for the /posts/{post} + Post $post happy path resolved by
18+
* Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver. The tag priority
19+
* configured in config/orm.php (and the priorities of FrameworkBundle's own
20+
* value resolvers) must stay compatible so that the entity argument is still
21+
* populated from the route placeholder.
22+
*/
23+
class EntityValueResolverFunctionalTest extends TestCase
24+
{
25+
public function testEntityArgumentResolvedFromRoutePlaceholder(): void
26+
{
27+
if (! interface_exists(EntityManagerInterface::class)) {
28+
self::markTestSkipped('This test requires ORM');
29+
}
30+
31+
$kernel = new EntityValueResolverFunctionalKernel();
32+
$kernel->boot();
33+
34+
try {
35+
$container = $kernel->getContainer();
36+
$em = $container->get('doctrine.orm.default_entity_manager');
37+
38+
// SchemaTool::createSchema triggers Schema::createTable, deprecated in
39+
// DBAL 4 (https://github.com/doctrine/dbal/pull/7373); the DBAL 4 fluent
40+
// replacement (Table::editor() / Column::editor()) is unavailable on
41+
// DBAL 3 which this branch must still support, so a raw CREATE TABLE is
42+
// emitted directly through the connection. The test kernel is SQLite-
43+
// only, so a SQLite literal is safe here.
44+
$em->getConnection()->executeStatement(
45+
'CREATE TABLE posts (id INTEGER NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id))',
46+
);
47+
48+
$post = new Post('Hello world');
49+
$em->persist($post);
50+
$em->flush();
51+
$em->clear();
52+
53+
$response = $kernel->handle(Request::create('/posts/' . $post->id, 'GET'));
54+
55+
self::assertSame(200, $response->getStatusCode());
56+
self::assertSame(
57+
['id' => $post->id, 'title' => 'Hello world'],
58+
json_decode((string) $response->getContent(), true),
59+
);
60+
} finally {
61+
$kernel->shutdown();
62+
}
63+
}
64+
}

0 commit comments

Comments
 (0)