8000 minor #52022 [Doctrine][DoctrineBridge][HttpFoundation][VarDumper] Ru… · symfony/symfony@f36e4ab · GitHub
[go: up one dir, main page]

Skip to content

Commit f36e4ab

Browse files
minor #52022 [Doctrine][DoctrineBridge][HttpFoundation][VarDumper] Run tests with ORM 3 and DBAL 4 (derrabus)
This PR was merged into the 6.3 branch. Discussion ---------- [Doctrine][DoctrineBridge][HttpFoundation][VarDumper] Run tests with ORM 3 and DBAL 4 | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Follow-up to #51997 | License | MIT Everything that got lost in the merge-up + a fix for the VarDumper testsuite. 😇 Commits ------- 81c40be Run tests with ORM 3 and DBAL 4
2 parents c947f78 + 81c40be commit f36e4ab

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

.github/patch-types.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
}
2424
// no break;
2525
case false !== strpos($file, '/vendor/'):
26+
case false !== strpos($file, '/src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php'):
27+
case false !== strpos($file, '/src/Symfony/Bridge/Doctrine/Middleware/Debug/'):
2628
case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'):
2729
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'):
2830
case false !== strpos($file, '/src/Symfony/Component/Cache/Tests/Fixtures/DriverWrapper.php'):

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"doctrine/collections": "^1.0|^2.0",
133133
"doctrine/data-fixtures": "^1.1",
134134
"doctrine/dbal": "^2.13.1|^3.0",
135-
"doctrine/orm": "^2.12",
135+
"doctrine/orm": "^2.12|^3",
136136
"dragonmantank/cron-expression": "^3.1",
137137
"egulias/email-validator": "^2.1.10|^3.1|^4",
138138
"guzzlehttp/promises": "^1.4",

src/Symfony/Bridge/Doctrine/Middleware/Debug/Statement.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ public function __construct(
3939
$this->query = new Query($sql);
4040
}
4141

42-
public function bindValue($param, $value, $type = null): void
42+
public function bindValue(int|string $param, mixed $value, ParameterType $type): void
4343
{
44-
$type ??= ParameterType::STRING;
4544
$this->query->setValue($param, $value, $type);
4645

4746
parent::bindValue($param, $value, $type);
4847
}
4948

50-
public function execute($params = null): ResultInterface
49+
public function execute(): ResultInterface
5150
{
5251
// clone to prevent variables by reference to change
5352
$this->debugDataHolder->addQuery($this->connectionName, $query = clone $this->query);
@@ -56,7 +55,7 @@ public function execute($params = null): ResultInterface
5655
$query->start();
5756

5857
try {
59-
return parent::execute($params);
58+
return parent::execute();
6059
} finally {
6160
$query->stop();
6261
$this->stopwatch?->stop('doctrine');

src/Symfony/Component/HttpFoundation/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"symfony/polyfill-php83": "^1.27"
2323
},
2424
"require-dev": {
25-
"doctrine/dbal": "^2.13.1|^3.0",
25+
"doctrine/dbal": "^2.13.1|^3|^4",
2626
"predis/predis": "^1.1|^2.0",
2727
"symfony/cache": "^6.3",
2828
"symfony/dependency-injection": "^5.4|^6.0",

src/Symfony/Component/VarDumper/Tests/Caster/DoctrineCasterTest.php

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,28 @@ public function testCastPersistentCollection()
3131

3232
$collection = new PersistentCollection($this->createMock(EntityManagerInterface::class), $classMetadata, new ArrayCollection(['test']));
3333

34-
$expected = <<<EODUMP
35-
Doctrine\ORM\PersistentCollection {
36-
%A
37-
-em: Mock_EntityManagerInterface_%s { …3}
38-
-backRefFieldName: null
39-
-typeClass: Doctrine\ORM\Mapping\ClassMetadata { …}
40-
%A
41-
EODUMP;
34+
if (property_exists(PersistentCollection::class, 'isDirty')) {
35+
// Collections >= 2
36+
$expected = <<<EODUMP
37+
Doctrine\ORM\PersistentCollection {
38+
%A
39+
-em: Mock_EntityManagerInterface_%s { …3}
40+
-backRefFieldName: null
41+
-isDirty: false
42+
-typeClass: Doctrine\ORM\Mapping\ClassMetadata { …}
43+
%A
44+
EODUMP;
45+
} else {
46+
// Collections 1
47+
$expected = <<<EODUMP
48+
Doctrine\ORM\PersistentCollection {
49+
%A
50+
-em: Mock_EntityManagerInterface_%s { …3}
51+
-backRefFieldName: null
52+
-typeClass: Doctrine\ORM\Mapping\ClassMetadata { …}
53+
%A
54+
EODUMP;
55+
}
4256

4357
$this->assertDumpMatchesFormat($expected, $collection);
4458
}

0 commit comments

Comments
 (0)
0