Skip to content

Commit

Permalink
Merge pull request #1709 from dmaicher/2.11.x
Browse files Browse the repository at this point in the history
Merge 2.10.x into 2.11.x
  • Loading branch information
dmaicher authored Oct 18, 2023
2 parents 09dc74c + fab97b6 commit 8ab2a63
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
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) {
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

0 comments on commit 8ab2a63

Please sign in to comment.