Skip to content

Commit

Permalink
Remove fragile assertions
Browse files Browse the repository at this point in the history
RuntimePublicReflectionProperty has been deprecated in favor of
RuntimeReflectionProperty.

Let us use a more robust assertion.
  • Loading branch information
greg0ire committed Nov 19, 2022
1 parent fc3201b commit 3a3c820
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -32,7 +32,7 @@
"doctrine/inflector": "^1.4 || ^2.0",
"doctrine/instantiator": "^1.3",
"doctrine/lexer": "^1.2.3",
"doctrine/persistence": "^2.4 || ^3",
"doctrine/persistence": "^2.4 || ^3.1",
"psr/cache": "^1 || ^2 || ^3",
"symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0",
"symfony/polyfill-php72": "^1.23",
Expand Down
15 changes: 0 additions & 15 deletions tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php
Expand Up @@ -5,7 +5,6 @@
namespace Doctrine\Tests\ORM\Functional;

use DateTime;
use Doctrine\Common\Reflection\RuntimePublicReflectionProperty as CommonRuntimePublicReflectionProperty;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\DiscriminatorColumn;
use Doctrine\ORM\Mapping\DiscriminatorMap;
Expand All @@ -19,10 +18,8 @@
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\ORM\Mapping\ReflectionEmbeddedProperty;
use Doctrine\ORM\Query\QueryException;
use Doctrine\Persistence\Reflection\RuntimePublicReflectionProperty;
use Doctrine\Tests\OrmFunctionalTestCase;

use function class_exists;
use function sprintf;

/** @group DDC-93 */
Expand All @@ -46,18 +43,6 @@ public function testMetadataHasReflectionEmbeddablesAccessible(): void
{
$classMetadata = $this->_em->getClassMetadata(DDC93Person::class);

if (class_exists(CommonRuntimePublicReflectionProperty::class)) {
self::assertInstanceOf(
CommonRuntimePublicReflectionProperty::class,
$classMetadata->getReflectionProperty('address')
);
} else {
self::assertInstanceOf(
RuntimePublicReflectionProperty::class,
$classMetadata->getReflectionProperty('address')
);
}

self::assertInstanceOf(ReflectionEmbeddedProperty::class, $classMetadata->getReflectionProperty('address.street'));
}

Expand Down

0 comments on commit 3a3c820

Please sign in to comment.