From 9fdf85c03a56659df291aebdbc5a0922f8da9bbe Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki <crynobone@gmail.com> Date: Tue, 10 Sep 2024 21:13:09 +0800 Subject: [PATCH] [11.x] Test Improvements (#52718) Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com> --- tests/Bus/QueueableTest.php | 17 +++++------------ tests/Support/SupportCollectionTest.php | 6 ------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/tests/Bus/QueueableTest.php b/tests/Bus/QueueableTest.php index a9026bca70e8..ab2e161cb8fa 100644 --- a/tests/Bus/QueueableTest.php +++ b/tests/Bus/QueueableTest.php @@ -3,6 +3,7 @@ namespace Illuminate\Tests\Bus; use Illuminate\Bus\Queueable; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class QueueableTest extends TestCase @@ -17,9 +18,7 @@ public static function connectionDataProvider(): array ]; } - /** - * @dataProvider connectionDataProvider - */ + #[DataProvider('connectionDataProvider')] public function testOnConnection(mixed $connection, ?string $expected): void { $job = new FakeJob(); @@ -28,9 +27,7 @@ public function testOnConnection(mixed $connection, ?string $expected): void $this->assertSame($job->connection, $expected); } - /** - * @dataProvider connectionDataProvider - */ + #[DataProvider('connectionDataProvider')] public function testAllOnConnection(mixed $connection, ?string $expected): void { $job = new FakeJob(); @@ -50,9 +47,7 @@ public static function queuesDataProvider(): array ]; } - /** - * @dataProvider queuesDataProvider - */ + #[DataProvider('queuesDataProvider')] public function testOnQueue(mixed $queue, ?string $expected): void { $job = new FakeJob(); @@ -61,9 +56,7 @@ public function testOnQueue(mixed $queue, ?string $expected): void $this->assertSame($job->queue, $expected); } - /** - * @dataProvider queuesDataProvider - */ + #[DataProvider('queuesDataProvider')] public function testAllOnQueue(mixed $queue, ?string $expected): void { $job = new FakeJob(); diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index e9e0b63979ac..ef0a5fd68f42 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -2003,9 +2003,6 @@ public function testSortByMany($collection) } #[DataProvider('collectionClassProvider')] - /** - * @dataProvider collectionClassProvider - */ public function testNaturalSortByManyWithNull($collection) { $itemFoo = new \stdClass(); @@ -2026,9 +2023,6 @@ public function testNaturalSortByManyWithNull($collection) } #[DataProvider('collectionClassProvider')] - /** - * @dataProvider collectionClassProvider - */ public function testSortKeys($collection) { $data = new $collection(['b' => 'dayle', 'a' => 'taylor']);