Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete RequiresPhp attributes #10631

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/EnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
use Doctrine\Tests\Models\Enums\Unit;
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RequiresPhp;

use function dirname;
use function sprintf;
use function uniqid;

#[RequiresPhp('8.1')]
class EnumTest extends OrmFunctionalTestCase
{
public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/Doctrine/Tests/ORM/Functional/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Doctrine\Tests\Models\Enums\UserStatus;
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhp;

use function count;
use function iterator_to_array;
Expand Down Expand Up @@ -168,7 +167,6 @@ public function testInvalidInputParameterThrowsException(): void
->getSingleResult();
}

#[RequiresPhp('8.1')]
public function testUseStringEnumCaseAsParameter(): void
{
$user = new CmsUser();
Expand Down Expand Up @@ -196,7 +194,6 @@ public function testUseStringEnumCaseAsParameter(): void
self::assertSame('jane', $result[0]->username);
}

#[RequiresPhp('8.1')]
public function testUseIntegerEnumCaseAsParameter(): void
{
$user = new CmsUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
use Doctrine\Tests\Models\ReadonlyProperties\SimpleBook;
use Doctrine\Tests\OrmFunctionalTestCase;
use Doctrine\Tests\TestUtil;
use PHPUnit\Framework\Attributes\RequiresPhp;

use function dirname;

#[RequiresPhp('8.1')]
class ReadonlyPropertiesTest extends OrmFunctionalTestCase
{
protected function setUp(): void
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH10336Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Doctrine\Tests\Models\GH10336\GH10336Entity;
use Doctrine\Tests\Models\GH10336\GH10336Relation;
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\RequiresPhp;

#[RequiresPhp('7.4')]
final class GH10336Test extends OrmFunctionalTestCase
{
public function setUp(): void
Expand Down
4 changes: 0 additions & 4 deletions tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
use Doctrine\Tests\OrmTestCase;
use DoctrineGlobalArticle;
use PHPUnit\Framework\Attributes\Group as TestGroup;
use PHPUnit\Framework\Attributes\RequiresPhp;
use ReflectionClass;
use stdClass;

Expand Down Expand Up @@ -797,7 +796,6 @@ public function testInvalidCascade(): void
$cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'UnknownClass', 'cascade' => ['invalid']]);
}

#[RequiresPhp('8.1')]
#[TestGroup('DDC-964')]
public function testInvalidPropertyAssociationOverrideNameException(): void
{
Expand All @@ -810,7 +808,6 @@ public function testInvalidPropertyAssociationOverrideNameException(): void
$cm->setAssociationOverride('invalidPropertyName', []);
}

#[RequiresPhp('8.1')]
#[TestGroup('DDC-964')]
public function testInvalidPropertyAttributeOverrideNameException(): void
{
Expand All @@ -823,7 +820,6 @@ public function testInvalidPropertyAttributeOverrideNameException(): void
$cm->setAttributeOverride('invalidPropertyName', []);
}

#[RequiresPhp('8.1')]
#[TestGroup('DDC-964')]
public function testInvalidOverrideAttributeFieldTypeException(): void
{
Expand Down
6 changes: 0 additions & 6 deletions tests/Doctrine/Tests/ORM/Mapping/MappingDriverTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
use Doctrine\Tests\Models\Upsertable\Updatable;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Depends;
use PHPUnit\Framework\Attributes\RequiresPhp;
use stdClass;

use function assert;
Expand Down Expand Up @@ -591,7 +590,6 @@ public function testIdentifierRequiredShouldMentionParentClasses(): void
}

#[\PHPUnit\Framework\Attributes\Group('DDC-3579')]
#[RequiresPhp('8.1')]
public function testInversedByOverrideMapping(): void
{
$factory = $this->createClassMetadataFactory();
Expand All @@ -606,7 +604,6 @@ public function testInversedByOverrideMapping(): void
}

#[\PHPUnit\Framework\Attributes\Group('DDC-5934')]
#[RequiresPhp('8.1')]
public function testFetchOverrideMapping(): void
{
// check override metadata
Expand All @@ -617,7 +614,6 @@ public function testFetchOverrideMapping(): void
}

#[\PHPUnit\Framework\Attributes\Group('DDC-964')]
#[RequiresPhp('8.1')]
public function testAssociationOverridesMapping(): void
{
$factory = $this->createClassMetadataFactory();
Expand Down Expand Up @@ -694,7 +690,6 @@ public function testAssociationOverridesMapping(): void
}

#[\PHPUnit\Framework\Attributes\Group('DDC-964')]
#[RequiresPhp('8.1')]
public function testAttributeOverridesMapping(): void
{
$factory = $this->createClassMetadataFactory();
Expand Down Expand Up @@ -958,7 +953,6 @@ public function testUpdatableColumn(): void
self::assertNull($metadata->getFieldMapping('updatableContent')->notUpdatable);
}

#[RequiresPhp('8.1')]
public function testEnumType(): void
{
$metadata = $this->createClassMetadata(Card::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
use Doctrine\Tests\Models\ReadonlyProperties\Author;
use InvalidArgumentException;
use LogicException;
use PHPUnit\Framework\Attributes\RequiresPhp;
use PHPUnit\Framework\TestCase;
use ReflectionProperty;

#[RequiresPhp('8.1')]
class ReflectionReadonlyPropertyTest extends TestCase
{
public function testSecondWriteWithSameValue(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/Doctrine/Tests/ORM/Query/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Generator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhp;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
Expand Down Expand Up @@ -293,7 +292,6 @@ public function testProcessParameterValueNull(): void
self::assertNull($query->processParameterValue(null));
}

#[RequiresPhp('8.1')]
public function testProcessParameterValueBackedEnum(): void
{
$query = $this->entityManager->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.status = :status');
Expand All @@ -302,7 +300,6 @@ public function testProcessParameterValueBackedEnum(): void
self::assertSame([2], $query->processParameterValue([AccessLevel::User]));
}

#[RequiresPhp('8.1')]
public function testProcessParameterValueBackedEnumArray(): void
{
$query = $this->entityManager->createQuery('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.status IN (:status)');
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/Tests/ORM/Tools/SchemaToolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
use Doctrine\Tests\Models\NullDefault\NullDefaultColumn;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhp;

use function count;
use function current;
Expand Down Expand Up @@ -184,7 +183,6 @@ public function testNullDefaultNotAddedToPlatformOptions(): void
->getPlatformOptions());
}

#[RequiresPhp('8.1')]
public function testEnumTypeAddedToCustomSchemaOptions(): void
{
$em = $this->getTestEntityManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhp;

/**
* Test the IdentifierFlattener utility class
*/
#[CoversClass(IdentifierFlattener::class)]
#[RequiresPhp('8.1')]
class IdentifierFlattenerEnumIdTest extends OrmFunctionalTestCase
{
protected function setUp(): void
Expand Down