Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions tests/Doctrine/Tests/ORM/Cache/CacheConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
use Doctrine\ORM\Cache\TimestampQueryCacheValidator;
use Doctrine\ORM\Cache\TimestampRegion;
use Doctrine\Tests\DoctrineTestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;

/**
* @group DDC-2183
* @covers \Doctrine\ORM\Cache\CacheConfiguration
*/
#[CoversClass(CacheConfiguration::class)]
#[Group('DDC-2183')]
class CacheConfigTest extends DoctrineTestCase
{
private CacheConfiguration $config;
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Cache/CacheKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
use Doctrine\ORM\Cache\CollectionCacheKey;
use Doctrine\ORM\Cache\EntityCacheKey;
use Doctrine\Tests\DoctrineTestCase;
use PHPUnit\Framework\Attributes\Group;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class CacheKeyTest extends DoctrineTestCase
{
public function testEntityCacheKeyIdentifierCollision(): void
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Cache/CacheLoggerChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
use Doctrine\ORM\Cache\QueryCacheKey;
use Doctrine\Tests\DoctrineTestCase;
use Doctrine\Tests\Models\Cache\State;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class CacheLoggerChainTest extends DoctrineTestCase
{
private CacheLoggerChain $logger;
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
use Doctrine\Tests\OrmTestCase;
use InvalidArgumentException;
use LogicException;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Cache\CacheItemPoolInterface;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class DefaultCacheFactoryTest extends OrmTestCase
{
private CacheFactory&MockObject $factory;
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Cache/DefaultCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
use Doctrine\Tests\Models\Cache\State;
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Group;
use ReflectionMethod;
use ReflectionProperty;

use function array_merge;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class DefaultCacheTest extends OrmTestCase
{
private DefaultCache $cache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
use Doctrine\Tests\Models\Cache\City;
use Doctrine\Tests\Models\Cache\State;
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\Group;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class DefaultCollectionHydratorTest extends OrmFunctionalTestCase
{
private DefaultCollectionHydrator $structure;
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Cache/DefaultEntityHydratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
use Doctrine\Tests\Models\Cache\Country;
use Doctrine\Tests\Models\Cache\State;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Group;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class DefaultEntityHydratorTest extends OrmTestCase
{
private DefaultEntityHydrator $structure;
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Cache/DefaultQueryCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
use Doctrine\Tests\Models\Cache\State;
use Doctrine\Tests\Models\Generic\BooleanModel;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Group;
use ReflectionMethod;

use function microtime;
use function sprintf;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class DefaultQueryCacheTest extends OrmTestCase
{
private DefaultQueryCache $queryCache;
Expand Down
20 changes: 8 additions & 12 deletions tests/Doctrine/Tests/ORM/Cache/DefaultRegionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
use Doctrine\ORM\Cache\Region\DefaultRegion;
use Doctrine\Tests\Mocks\CacheEntryMock;
use Doctrine\Tests\Mocks\CacheKeyMock;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;

use function array_map;

/**
* @extends RegionTestCase<DefaultRegion>
* @group DDC-2183
*/
/** @extends RegionTestCase<DefaultRegion> */
#[Group('DDC-2183')]
class DefaultRegionTest extends RegionTestCase
{
protected function createRegion(): DefaultRegion
Expand Down Expand Up @@ -94,10 +94,8 @@ public function testGetMultiPreservesOrderAndKeys(): void
], $actual);
}

/**
* @test
* @group GH7266
*/
#[Test]
#[Group('GH7266')]
public function corruptedDataDoesNotLeakIntoApplicationWhenGettingSingleEntry(): void
{
$key1 = new CacheKeyMock('key.1');
Expand All @@ -111,10 +109,8 @@ public function corruptedDataDoesNotLeakIntoApplicationWhenGettingSingleEntry():
self::assertNull($this->region->get($key1));
}

/**
* @test
* @group GH7266
*/
#[Test]
#[Group('GH7266')]
public function corruptedDataDoesNotLeakIntoApplicationWhenGettingMultipleEntries(): void
{
$key1 = new CacheKeyMock('key.1');
Expand Down
7 changes: 3 additions & 4 deletions tests/Doctrine/Tests/ORM/Cache/FileLockRegionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Doctrine\ORM\Cache\Region\FileLockRegion;
use Doctrine\Tests\Mocks\CacheEntryMock;
use Doctrine\Tests\Mocks\CacheKeyMock;
use PHPUnit\Framework\Attributes\Group;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use ReflectionMethod;
Expand All @@ -21,10 +22,8 @@
use function uniqid;
use function unlink;

/**
* @extends RegionTestCase<FileLockRegion>
* @group DDC-2183
*/
/** @extends RegionTestCase<FileLockRegion> */
#[Group('DDC-2183')]
class FileLockRegionTest extends RegionTestCase
{
protected string $directory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
use Doctrine\Tests\Mocks\EntityManagerMock;
use Doctrine\Tests\Models\Cache\State;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;

/** @group DDC-2183 */
#[Group('DDC-2183')]
abstract class CollectionPersisterTestCase extends OrmTestCase
{
protected Region&MockObject $region;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use Doctrine\ORM\Cache\Region;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Persisters\Collection\CollectionPersister;
use PHPUnit\Framework\Attributes\Group;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class NonStrictReadWriteCachedCollectionPersisterTest extends CollectionPersisterTestCase
{
protected function createPersister(EntityManagerInterface $em, CollectionPersister $persister, Region $region, array $mapping): AbstractCollectionPersister
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use Doctrine\ORM\Cache\Region;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Persisters\Collection\CollectionPersister;
use PHPUnit\Framework\Attributes\Group;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class ReadOnlyCachedCollectionPersisterTest extends CollectionPersisterTestCase
{
protected function createPersister(EntityManagerInterface $em, CollectionPersister $persister, Region $region, array $mapping): AbstractCollectionPersister
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Persisters\Collection\CollectionPersister;
use Doctrine\Tests\Models\Cache\State;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionProperty;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class ReadWriteCachedCollectionPersisterTest extends CollectionPersisterTestCase
{
protected function createPersister(EntityManagerInterface $em, CollectionPersister $persister, Region $region, array $mapping): AbstractCollectionPersister
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
use Doctrine\Tests\Mocks\EntityManagerMock;
use Doctrine\Tests\Models\Cache\Country;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;

/** @group DDC-2183 */
#[Group('DDC-2183')]
abstract class EntityPersisterTestCase extends OrmTestCase
{
protected Region&MockObject $region;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Persisters\Entity\EntityPersister;
use Doctrine\Tests\Models\Cache\Country;
use PHPUnit\Framework\Attributes\Group;
use ReflectionProperty;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class NonStrictReadWriteCachedEntityPersisterTest extends EntityPersisterTestCase
{
protected function createPersister(EntityManagerInterface $em, EntityPersister $persister, Region $region, ClassMetadata $metadata): AbstractEntityPersister
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Persisters\Entity\EntityPersister;
use Doctrine\Tests\Models\Cache\Country;
use PHPUnit\Framework\Attributes\Group;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class ReadOnlyCachedEntityPersisterTest extends EntityPersisterTestCase
{
protected function createPersister(EntityManagerInterface $em, EntityPersister $persister, Region $region, ClassMetadata $metadata): AbstractEntityPersister
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Persisters\Entity\EntityPersister;
use Doctrine\Tests\Models\Cache\Country;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionProperty;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class ReadWriteCachedEntityPersisterTest extends EntityPersisterTestCase
{
protected function createPersister(EntityManagerInterface $em, EntityPersister $persister, Region $region, ClassMetadata $metadata): AbstractEntityPersister
Expand Down
10 changes: 5 additions & 5 deletions tests/Doctrine/Tests/ORM/Cache/RegionTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
use Doctrine\Tests\Mocks\CacheEntryMock;
use Doctrine\Tests\Mocks\CacheKeyMock;
use Doctrine\Tests\OrmFunctionalTestCase;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Adapter\ArrayAdapter;

/**
* @template TRegion of Region
* @group DDC-2183
*/
/** @template TRegion of Region */
#[Group('DDC-2183')]
abstract class RegionTestCase extends OrmFunctionalTestCase
{
/** @psalm-var TRegion */
Expand All @@ -43,7 +43,7 @@ public static function dataProviderCacheValues(): array
];
}

/** @dataProvider dataProviderCacheValues */
#[DataProvider('dataProviderCacheValues')]
public function testPutGetContainsEvict(CacheKey $key, CacheEntry $value): void
{
self::assertFalse($this->region->contains($key));
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Cache/StatisticsCacheLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
use Doctrine\ORM\Cache\QueryCacheKey;
use Doctrine\Tests\DoctrineTestCase;
use Doctrine\Tests\Models\Cache\State;
use PHPUnit\Framework\Attributes\Group;

/** @group DDC-2183 */
#[Group('DDC-2183')]
class StatisticsCacheLoggerTest extends DoctrineTestCase
{
private StatisticsCacheLogger $logger;
Expand Down
7 changes: 4 additions & 3 deletions tests/Doctrine/Tests/ORM/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use Doctrine\Tests\DoctrineTestCase;
use Doctrine\Tests\Models\DDC753\DDC753CustomRepository;
use PHPUnit\Framework\Attributes\Group;
use Psr\Cache\CacheItemPoolInterface;

/**
Expand Down Expand Up @@ -186,7 +187,7 @@ public function testSetGetQuoteStrategy(): void
self::assertSame($quoteStrategy, $this->configuration->getQuoteStrategy());
}

/** @group DDC-1955 */
#[Group('DDC-1955')]
public function testSetGetEntityListenerResolver(): void
{
self::assertInstanceOf(EntityListenerResolver::class, $this->configuration->getEntityListenerResolver());
Expand All @@ -196,7 +197,7 @@ public function testSetGetEntityListenerResolver(): void
self::assertSame($resolver, $this->configuration->getEntityListenerResolver());
}

/** @group DDC-2183 */
#[Group('DDC-2183')]
public function testSetGetSecondLevelCacheConfig(): void
{
$mockClass = $this->createMock(CacheConfiguration::class);
Expand All @@ -206,7 +207,7 @@ public function testSetGetSecondLevelCacheConfig(): void
self::assertEquals($mockClass, $this->configuration->getSecondLevelCacheConfiguration());
}

/** @group GH10313 */
#[Group('GH10313')]
public function testSetGetTypedFieldMapper(): void
{
self::assertEmpty($this->configuration->getTypedFieldMapper());
Expand Down
14 changes: 7 additions & 7 deletions tests/Doctrine/Tests/ORM/EntityManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\OrmTestCase;
use Generator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Group;
use stdClass;
use TypeError;

Expand All @@ -33,7 +35,7 @@ protected function setUp(): void
$this->entityManager = $this->getTestEntityManager();
}

/** @group DDC-899 */
#[Group('DDC-899')]
public function testIsOpen(): void
{
self::assertTrue($this->entityManager->isOpen());
Expand Down Expand Up @@ -129,7 +131,7 @@ public static function dataAffectedByErrorIfClosedException(): array
];
}

/** @dataProvider dataAffectedByErrorIfClosedException */
#[DataProvider('dataAffectedByErrorIfClosedException')]
public function testAffectedByErrorIfClosedException(string $methodName): void
{
$this->expectException(EntityManagerClosed::class);
Expand All @@ -152,10 +154,8 @@ public static function dataToBeReturnedByWrapInTransaction(): Generator
yield ['foo'];
}

/**
* @dataProvider dataToBeReturnedByWrapInTransaction
* @group DDC-1125
*/
#[DataProvider('dataToBeReturnedByWrapInTransaction')]
#[Group('DDC-1125')]
public function testWrapInTransactionAcceptsReturn(mixed $expectedValue): void
{
$return = $this->entityManager->wrapInTransaction(
Expand All @@ -165,7 +165,7 @@ public function testWrapInTransactionAcceptsReturn(mixed $expectedValue): void
$this->assertSame($expectedValue, $return);
}

/** @group #5796 */
#[Group('#5796')]
public function testWrapInTransactionReThrowsThrowables(): void
{
try {
Expand Down
Loading