Created
December 16, 2021 23:44
-
-
Save TSKGunGun/51f422295ce2c4d1d0ebbbe6aef4585e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class sample_Test extends TestCase | |
{ | |
use RefreshDatabase; | |
use WithFaker; | |
protected function setUp(): void | |
{ | |
parent::setUp(); | |
Category::factory(5)->create(); | |
} | |
public function Sample_DataProvider() | |
{ | |
return [ | |
'1' => ['param' => 0], | |
'2' => ['param' => 1], | |
'3' => ['param' => 2], | |
]; | |
} | |
/** | |
* サンプルテスト | |
* @test | |
* @dataProvider Sample_DataProvider | |
*/ | |
public function test_Sample(int $param): void | |
{ | |
foreach(Category::all() as $i) | |
{ | |
printf("ID: {$i->id}\n"); | |
} | |
$this->assertTrue(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment