Skip to content

Commit 2ca63df

Browse files
authored
Merge pull request #12161 from greg0ire/proper-attribute
Switch to IgnoreDeprecations
2 parents 48434f4 + 0d4413c commit 2ca63df

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"phpstan/extension-installer": "^1.4",
4444
"phpstan/phpstan": "2.1.22",
4545
"phpstan/phpstan-deprecation-rules": "^2",
46-
"phpunit/phpunit": "^10.4.0 || ^11.5",
46+
"phpunit/phpunit": "^10.5.0 || ^11.5",
4747
"psr/log": "^1 || ^2 || ^3",
4848
"squizlabs/php_codesniffer": "3.13.2",
4949
"symfony/cache": "^5.4 || ^6.2 || ^7.0"

tests/Tests/ORM/ConfigurationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
1919
use Doctrine\Tests\Models\DDC753\DDC753CustomRepository;
2020
use PHPUnit\Framework\Attributes\Group;
21+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
2122
use PHPUnit\Framework\Attributes\RequiresPhp;
22-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
2323
use PHPUnit\Framework\TestCase;
2424
use Psr\Cache\CacheItemPoolInterface;
2525

@@ -39,7 +39,7 @@ protected function setUp(): void
3939
$this->configuration = new Configuration();
4040
}
4141

42-
#[WithoutErrorHandler]
42+
#[IgnoreDeprecations]
4343
public function testSetGetProxyDir(): void
4444
{
4545
self::assertNull($this->configuration->getProxyDir()); // defaults
@@ -48,7 +48,7 @@ public function testSetGetProxyDir(): void
4848
self::assertSame(__DIR__, $this->configuration->getProxyDir());
4949
}
5050

51-
#[WithoutErrorHandler]
51+
#[IgnoreDeprecations]
5252
public function testSetGetAutoGenerateProxyClasses(): void
5353
{
5454
self::assertSame(ProxyFactory::AUTOGENERATE_ALWAYS, $this->configuration->getAutoGenerateProxyClasses()); // defaults
@@ -63,7 +63,7 @@ public function testSetGetAutoGenerateProxyClasses(): void
6363
self::assertSame(ProxyFactory::AUTOGENERATE_FILE_NOT_EXISTS, $this->configuration->getAutoGenerateProxyClasses());
6464
}
6565

66-
#[WithoutErrorHandler]
66+
#[IgnoreDeprecations]
6767
public function testSetGetProxyNamespace(): void
6868
{
6969
self::assertNull($this->configuration->getProxyNamespace()); // defaults
@@ -222,7 +222,7 @@ public function testSetGetTypedFieldMapper(): void
222222
}
223223

224224
#[RequiresPhp('8.4')]
225-
#[WithoutErrorHandler]
225+
#[IgnoreDeprecations]
226226
public function testDisablingNativeLazyObjectsIsDeprecated(): void
227227
{
228228
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/12005');

tests/Tests/ORM/Functional/ParserResultSerializationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Doctrine\Tests\OrmFunctionalTestCase;
1515
use Generator;
1616
use PHPUnit\Framework\Attributes\DataProvider;
17-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
17+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1818
use ReflectionMethod;
1919
use Symfony\Component\VarExporter\Instantiator;
2020
use Symfony\Component\VarExporter\VarExporter;
@@ -35,7 +35,7 @@ protected function setUp(): void
3535

3636
/** @param Closure(ParserResult): ParserResult $toSerializedAndBack */
3737
#[DataProvider('provideToSerializedAndBack')]
38-
#[WithoutErrorHandler]
38+
#[IgnoreDeprecations]
3939
public function testSerializeParserResultForQueryWithSqlWalker(Closure $toSerializedAndBack): void
4040
{
4141
$query = $this->_em

tests/Tests/ORM/Mapping/ClassMetadataTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
use LogicException;
5555
use PHPUnit\Framework\Attributes\DataProvider;
5656
use PHPUnit\Framework\Attributes\Group as TestGroup;
57-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
57+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
5858
use ReflectionClass;
5959
use stdClass;
6060

@@ -1126,7 +1126,7 @@ public function testItAddingLifecycleCallbackOnEmbeddedClassIsIllegal(): void
11261126
$metadata->addLifecycleCallback('foo', 'bar');
11271127
}
11281128

1129-
#[WithoutErrorHandler]
1129+
#[IgnoreDeprecations]
11301130
public function testGettingAnFQCNForNullIsDeprecated(): void
11311131
{
11321132
$metadata = new ClassMetadata(self::class);
@@ -1165,7 +1165,7 @@ public function testClassNameMappingDiscriminatorValue(): void
11651165
);
11661166
}
11671167

1168-
#[WithoutErrorHandler]
1168+
#[IgnoreDeprecations]
11691169
public function testDiscriminatorMapWithSameClassMultipleTimesDeprecated(): void
11701170
{
11711171
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/issues/3519');

tests/Tests/ORM/Mapping/TableMappingTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66

77
use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
88
use Doctrine\ORM\Mapping\Table;
9-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
9+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1010
use PHPUnit\Framework\TestCase;
1111

1212
final class TableMappingTest extends TestCase
1313
{
1414
use VerifyDeprecations;
1515

16-
#[WithoutErrorHandler]
16+
#[IgnoreDeprecations]
1717
public function testDeprecationOnIndexesPropertyIsTriggered(): void
1818
{
1919
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/11357');
2020

2121
new Table(indexes: []);
2222
}
2323

24-
#[WithoutErrorHandler]
24+
#[IgnoreDeprecations]
2525
public function testDeprecationOnUniqueConstraintsPropertyIsTriggered(): void
2626
{
2727
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/pull/11357');

tests/Tests/ORM/ORMSetupTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
use Doctrine\ORM\Mapping\Driver\XmlDriver;
1212
use Doctrine\ORM\ORMSetup;
1313
use PHPUnit\Framework\Attributes\Group;
14+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1415
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
1516
use PHPUnit\Framework\Attributes\RequiresSetting;
16-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
1717
use PHPUnit\Framework\TestCase;
1818
use ReflectionProperty;
1919
use Symfony\Component\Cache\Adapter\AbstractAdapter;
@@ -28,7 +28,7 @@ class ORMSetupTest extends TestCase
2828
{
2929
use VerifyDeprecations;
3030

31-
#[WithoutErrorHandler]
31+
#[IgnoreDeprecations]
3232
public function testAttributeConfiguration(): void
3333
{
3434
if (PHP_VERSION_ID >= 80400) {
@@ -51,7 +51,7 @@ public function testAttributeConfig(): void
5151
self::assertInstanceOf(AttributeDriver::class, $config->getMetadataDriverImpl());
5252
}
5353

54-
#[WithoutErrorHandler]
54+
#[IgnoreDeprecations]
5555
public function testXMLConfiguration(): void
5656
{
5757
if (PHP_VERSION_ID >= 80400) {
@@ -104,7 +104,7 @@ public function testCacheNamespaceShouldBeGeneratedForApcu(): void
104104
}
105105

106106
#[Group('DDC-1350')]
107-
#[WithoutErrorHandler]
107+
#[IgnoreDeprecations]
108108
public function testConfigureProxyDir(): void
109109
{
110110
$config = ORMSetup::createAttributeMetadataConfiguration([], true, '/foo');

tests/Tests/ORM/Proxy/ProxyFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
use Doctrine\Tests\Models\ECommerce\ECommerceFeature;
2222
use Doctrine\Tests\OrmTestCase;
2323
use PHPUnit\Framework\Attributes\Group;
24+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
2425
use PHPUnit\Framework\Attributes\RequiresPhp;
25-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
2626
use ReflectionClass;
2727
use ReflectionProperty;
2828
use stdClass;
@@ -247,7 +247,7 @@ public function testProxyFactoryAcceptsNullProxyArgsWhenNativeLazyObjectsAreEnab
247247
}
248248

249249
#[RequiresPhp('8.4')]
250-
#[WithoutErrorHandler]
250+
#[IgnoreDeprecations]
251251
public function testProxyFactoryTriggersDeprecationWhenNativeLazyObjectsAreDisabled(): void
252252
{
253253
$this->emMock->getConfiguration()->enableNativeLazyObjects(false);

tests/Tests/Proxy/AutoloaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Doctrine\ORM\Proxy\Autoloader;
88
use PHPUnit\Framework\Attributes\DataProvider;
9-
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
9+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1010
use PHPUnit\Framework\TestCase;
1111

1212
use function class_exists;
@@ -32,7 +32,7 @@ public static function dataResolveFile(): iterable
3232

3333
/** @param class-string $className */
3434
#[DataProvider('dataResolveFile')]
35-
#[WithoutErrorHandler]
35+
#[IgnoreDeprecations]
3636
public function testResolveFile(
3737
string $proxyDir,
3838
string $proxyNamespace,
@@ -43,7 +43,7 @@ public function testResolveFile(
4343
self::assertEquals($expectedProxyFile, $actualProxyFile);
4444
}
4545

46-
#[WithoutErrorHandler]
46+
#[IgnoreDeprecations]
4747
public function testAutoload(): void
4848
{
4949
if (file_exists(sys_get_temp_dir() . '/AutoloaderTestClass.php')) {

0 commit comments

Comments
 (0)