|
3 | 3 | namespace Composite\DB\Tests\Table; |
4 | 4 |
|
5 | 5 | use Composite\DB\AbstractCachedTable; |
6 | | -use Composite\DB\AbstractTable; |
7 | | -use Composite\DB\Exceptions\DbException; |
8 | 6 | use Composite\DB\Tests\TestStand\Entities; |
9 | 7 | use Composite\DB\Tests\TestStand\Tables; |
10 | 8 | use Composite\DB\Where; |
11 | 9 | use Composite\Entity\AbstractEntity; |
12 | 10 | use Composite\DB\Tests\Helpers; |
| 11 | +use PHPUnit\Framework\Attributes\DataProvider; |
13 | 12 | use Ramsey\Uuid\Uuid; |
14 | 13 |
|
15 | 14 | final class AbstractCachedTableTest extends \PHPUnit\Framework\TestCase |
@@ -43,9 +42,7 @@ public static function getOneCacheKey_dataProvider(): array |
43 | 42 | ]; |
44 | 43 | } |
45 | 44 |
|
46 | | - /** |
47 | | - * @dataProvider getOneCacheKey_dataProvider |
48 | | - */ |
| 45 | + #[DataProvider('getOneCacheKey_dataProvider')] |
49 | 46 | public function test_getOneCacheKey(AbstractCachedTable $table, AbstractEntity $object, string $expected): void |
50 | 47 | { |
51 | 48 | $reflectionMethod = new \ReflectionMethod($table, 'getOneCacheKey'); |
@@ -88,9 +85,7 @@ public static function getCountCacheKey_dataProvider(): array |
88 | 85 | ]; |
89 | 86 | } |
90 | 87 |
|
91 | | - /** |
92 | | - * @dataProvider getCountCacheKey_dataProvider |
93 | | - */ |
| 88 | + #[DataProvider('getCountCacheKey_dataProvider')] |
94 | 89 | public function test_getCountCacheKey(array|Where $where, string $expected): void |
95 | 90 | { |
96 | 91 | $table = new Tables\TestAutoincrementCachedTable(Helpers\CacheHelper::getCache()); |
@@ -159,9 +154,7 @@ public static function getListCacheKey_dataProvider(): array |
159 | 154 | ]; |
160 | 155 | } |
161 | 156 |
|
162 | | - /** |
163 | | - * @dataProvider getListCacheKey_dataProvider |
164 | | - */ |
| 157 | + #[DataProvider('getListCacheKey_dataProvider')] |
165 | 158 | public function test_getListCacheKey(array|Where $where, array $orderBy, ?int $limit, string $expected): void |
166 | 159 | { |
167 | 160 | $table = new Tables\TestAutoincrementCachedTable(Helpers\CacheHelper::getCache()); |
@@ -197,9 +190,7 @@ public static function getCustomCacheKey_dataProvider(): array |
197 | 190 | ]; |
198 | 191 | } |
199 | 192 |
|
200 | | - /** |
201 | | - * @dataProvider getCustomCacheKey_dataProvider |
202 | | - */ |
| 193 | + #[DataProvider('getCustomCacheKey_dataProvider')] |
203 | 194 | public function test_getCustomCacheKey(array $parts, string $expected): void |
204 | 195 | { |
205 | 196 | $table = new Tables\TestAutoincrementCachedTable(Helpers\CacheHelper::getCache()); |
@@ -253,9 +244,7 @@ public static function collectCacheKeysByEntity_dataProvider(): array |
253 | 244 | ]; |
254 | 245 | } |
255 | 246 |
|
256 | | - /** |
257 | | - * @dataProvider collectCacheKeysByEntity_dataProvider |
258 | | - */ |
| 247 | + #[DataProvider('collectCacheKeysByEntity_dataProvider')] |
259 | 248 | public function test_collectCacheKeysByEntity(AbstractEntity $entity, AbstractCachedTable $table, array $expected): void |
260 | 249 | { |
261 | 250 | $reflectionMethod = new \ReflectionMethod($table, 'collectCacheKeysByEntity'); |
|
0 commit comments