Skip to content

Commit

Permalink
Switch test data provider to Generator::class
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Nov 12, 2024
1 parent a56a1cc commit 7ab04ae
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/CompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Intervention\Zodiac\Tests;

use Generator;
use Intervention\Zodiac\Compatibility;
use Intervention\Zodiac\Zodiacs\Aquarius;
use Intervention\Zodiac\Zodiacs\Aries;
Expand All @@ -30,10 +31,8 @@ public function testCalculate(string $a, string $b): void
$this->assertTrue($result >= 0 && $result <= 1);
}

public static function factorDataProvider(): array
public static function factorDataProvider(): Generator
{
$data = [];

$zodiacs = [
Aquarius::class,
Aries::class,
Expand All @@ -51,10 +50,8 @@ public static function factorDataProvider(): array

foreach ($zodiacs as $a) {
foreach ($zodiacs as $b) {
$data[] = [$a, $b];
yield [$a, $b];
}
}

return $data;
}
}

0 comments on commit 7ab04ae

Please sign in to comment.