Migrate from PHPUnit annotations to native attributes

This commit is contained in:
Alejandro Celaya
2023-02-09 20:42:18 +01:00
parent 650a286982
commit 04bbd471ff
188 changed files with 776 additions and 1082 deletions

View File

@@ -5,6 +5,8 @@ declare(strict_types=1);
namespace ShlinkioTest\Shlink\Core\Util;
use Doctrine\ORM\EntityManagerInterface;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use RuntimeException;
@@ -21,10 +23,7 @@ class DoctrineBatchHelperTest extends TestCase
$this->helper = new DoctrineBatchHelper($this->em);
}
/**
* @test
* @dataProvider provideIterables
*/
#[Test, DataProvider('provideIterables')]
public function entityManagerIsFlushedAndClearedTheExpectedAmountOfTimes(
array $iterable,
int $batchSize,
@@ -50,7 +49,7 @@ class DoctrineBatchHelperTest extends TestCase
yield [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 11, 1];
}
/** @test */
#[Test]
public function transactionIsRolledBackWhenAnErrorOccurs(): void
{
$this->em->expects($this->once())->method('flush')->willThrowException(new RuntimeException());