Skip to content
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

Merge 2.10.x into 2.11.x #1709

Merged
merged 6 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- "stable"
symfony-require:
- ""
remove-orm:
- false
include:
# Tests the lowest set of dependencies
- dependencies: "lowest"
Expand All @@ -46,6 +48,12 @@ jobs:
dependencies: "highest"
php-version: "8.2"

# DBAL only without ORM
- php-version: "8.2"
dependencies: "highest"
stability: "stable"
remove-orm: true

# Bleeding edge
- php-version: "8.2"
dependencies: "highest"
Expand Down Expand Up @@ -76,6 +84,10 @@ jobs:
run: "composer config minimum-stability stable"
if: "${{ matrix.stability == 'stable' }}"

- name: "Remove doctrine/orm"
run: "composer remove doctrine/orm --dev --no-update"
if: "${{ matrix.remove-orm }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
Expand Down
4 changes: 2 additions & 2 deletions Tests/DataCollector/DoctrineDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
use Symfony\Bridge\Doctrine\Middleware\Debug\DebugDataHolder;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Kernel;

use function interface_exists;
use function method_exists;

class DoctrineDataCollectorTest extends TestCase
{
Expand Down Expand Up @@ -133,7 +133,7 @@ public function testGetGroupedQueries(): void
/** @group legacy */
public function testGetGroupedQueriesWithDeprecatedDebugStackLogger(): void
{
if (Kernel::VERSION_ID >= 70000) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symfony/framework-bundle 6.4 and symfony/web-profiler-bundle 7.0 were installed so this condition did not work

if (! method_exists(DoctrineDataCollector::class, 'addLogger')) {
$this->markTestSkipped('This test requires symfony < 7.0');
}

Expand Down
25 changes: 19 additions & 6 deletions Tests/DependencyInjection/DoctrineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,10 @@ public function testAnnotationsBundleMappingDetection(): void
/** @requires PHP 8 */
public function testAttributesBundleMappingDetection(): void
{
if (! interface_exists(EntityManagerInterface::class)) {
self::markTestSkipped('This test requires ORM');
}

$container = $this->getContainer(['AttributesBundle']);
$extension = new DoctrineExtension();

Expand Down Expand Up @@ -1204,6 +1208,10 @@ public static function cacheConfigurationProvider(): array
/** @requires PHP 8 */
public function testAsEntityListenerAttribute()
{
if (! interface_exists(EntityManagerInterface::class)) {
self::markTestSkipped('This test requires ORM');
}

$container = $this->getContainer();
$extension = new DoctrineExtension();

Expand Down Expand Up @@ -1238,6 +1246,10 @@ public function testAsEntityListenerAttribute()
/** @requires PHP 8 */
public function testAsDoctrineListenerAttribute()
{
if (! interface_exists(EntityManagerInterface::class)) {
self::markTestSkipped('This test requires ORM');
}

$container = $this->getContainer();
$extension = new DoctrineExtension();

Expand Down Expand Up @@ -1271,7 +1283,7 @@ public function testRegistrationsWithMiddlewaresAndSfDebugMiddleware(): void
$container = $this->getContainer();
$extension = new DoctrineExtension();

$config = BundleConfigurationBuilder::createBuilderWithBaseValues()
$config = BundleConfigurationBuilder::createBuilder()
->addConnection([
'connections' => [
'conn1' => [
Expand All @@ -1293,7 +1305,6 @@ public function testRegistrationsWithMiddlewaresAndSfDebugMiddleware(): void
],
],
])
->addBaseEntityManager()
->build();

$extension->load([$config], $container);
Expand Down Expand Up @@ -1341,7 +1352,7 @@ public function testDefinitionsToLogAndProfile(): void
$container = $this->getContainer();
$extension = new DoctrineExtension();

$config = BundleConfigurationBuilder::createBuilderWithBaseValues()
$config = BundleConfigurationBuilder::createBuilder()
->addConnection([
'connections' => [
'conn1' => [
Expand All @@ -1356,7 +1367,6 @@ public function testDefinitionsToLogAndProfile(): void
],
],
])
->addBaseEntityManager()
->build();

$extension->load([$config], $container);
Expand Down Expand Up @@ -1395,7 +1405,7 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void
$container = $this->getContainer();
$extension = new DoctrineExtension();

$config = BundleConfigurationBuilder::createBuilderWithBaseValues()
$config = BundleConfigurationBuilder::createBuilder()
->addConnection([
'connections' => [
'conn' => [
Expand All @@ -1404,7 +1414,6 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void
],
],
])
->addBaseEntityManager()
->build();

$extension->load([$config], $container);
Expand All @@ -1421,6 +1430,10 @@ public function testDefinitionsToLogQueriesLoggingFalse(): void
*/
public function testControllerResolver(bool $simpleEntityManagerConfig): void
{
if (! interface_exists(EntityManagerInterface::class)) {
self::markTestSkipped('This test requires ORM');
}

$container = $this->getContainer();
$extension = new DoctrineExtension();
$config = BundleConfigurationBuilder::createBuilderWithBaseValues()->build();
Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/Fixtures/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
$container->loadFromExtension('framework', [
'secret' => 'F00',
'http_method_override' => false,
'annotations' => class_exists(Annotation::class) && Kernel::VERSION_ID <= 60400,
'annotations' => class_exists(Annotation::class) && Kernel::VERSION_ID < 60400,
'php_errors' => ['log' => true],
] + (Kernel::VERSION_ID >= 60200 ? ['handle_all_throwables' => true] : []));
$container->loadFromExtension('doctrine', [
Expand Down
1 change: 1 addition & 0 deletions Tests/ProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function testRender(): void
'collector' => $this->collector,
'queries' => $this->debugDataHolder->getData(),
'profiler_markup_version' => 3,
'profile_type' => 'request',
]);

$expectedEscapedSql = 'SELECT&#x0A;&#x20;&#x20;&#x2A;&#x0A;FROM&#x0A;&#x20;&#x20;foo&#x0A;WHERE&#x0A;&#x20;&#x20;bar&#x20;IN&#x20;&#x28;&#x3F;,&#x20;&#x3F;&#x29;&#x0A;&#x20;&#x20;AND&#x20;&quot;&quot;&#x20;&gt;&#x3D;&#x20;&quot;&quot;';
Expand Down