Skip to content

Commit dbe6111

Browse files
authored
Merge pull request #479 from mpdude/fix-test-deprecation-reporting
Fix reporting of deprecations in tests
2 parents 76f6bd4 + 704ff97 commit dbe6111

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
colors="true"
55
beStrictAboutOutputDuringTests="true"
66
failOnDeprecation="true"
7+
bootstrap="tests/bootstrap.php"
78
>
89
<testsuites>
910
<testsuite name="Doctrine Collections Test Suite">

tests/CriteriaTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testConstructor(): void
3030
$criteria = new Criteria($expr, ['foo' => Order::Ascending], 10, 20);
3131

3232
self::assertSame($expr, $criteria->getWhereExpression());
33-
self::assertSame(['foo' => Order::Ascending->value], $criteria->getOrderings());
33+
self::assertSame(['foo' => Order::Ascending], $criteria->orderings());
3434
self::assertSame(10, $criteria->getFirstResult());
3535
self::assertSame(20, $criteria->getMaxResults());
3636
}
@@ -44,7 +44,6 @@ public function testDeprecatedNullOffset(): void
4444
$criteria = new Criteria($expr, ['foo' => Order::Ascending], null, 20);
4545

4646
self::assertSame($expr, $criteria->getWhereExpression());
47-
self::assertSame(['foo' => 'ASC'], $criteria->getOrderings());
4847
self::assertSame(['foo' => Order::Ascending], $criteria->orderings());
4948
self::assertNull($criteria->getFirstResult());
5049
self::assertSame(20, $criteria->getMaxResults());
@@ -56,7 +55,7 @@ public function testDefaultConstructor(): void
5655
$criteria = new Criteria();
5756

5857
self::assertNull($criteria->getWhereExpression());
59-
self::assertSame([], $criteria->getOrderings());
58+
self::assertSame([], $criteria->orderings());
6059
self::assertNull($criteria->getFirstResult());
6160
self::assertNull($criteria->getMaxResults());
6261
}
@@ -136,12 +135,14 @@ public function testExpr(): void
136135
self::assertInstanceOf(ExpressionBuilder::class, Criteria::expr());
137136
}
138137

138+
#[IgnoreDeprecations]
139139
public function testPassingNonOrderEnumToOrderByIsDeprecated(): void
140140
{
141141
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/collections/pull/389');
142142
$criteria = Criteria::create()->orderBy(['foo' => 'ASC']);
143143
}
144144

145+
#[IgnoreDeprecations]
145146
public function testConstructingCriteriaWithNonOrderEnumIsDeprecated(): void
146147
{
147148
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/collections/pull/389');
@@ -155,6 +156,7 @@ public function testUsingOrderEnumIsTheRightWay(): void
155156
new Criteria(null, ['foo' => Order::Ascending]);
156157
}
157158

159+
#[IgnoreDeprecations]
158160
public function testCallingGetOrderingsIsDeprecated(): void
159161
{
160162
$criteria = Criteria::create()->orderBy(['foo' => Order::Ascending]);

tests/bootstrap.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Doctrine\Deprecations\Deprecation;
6+
7+
Deprecation::withoutDeduplication();

0 commit comments

Comments
 (0)