PHP code example of dknx01 / data-fixtures-phpunit
1. Go to this page and download the library: Download dknx01/data-fixtures-phpunit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dknx01 / data-fixtures-phpunit example snippets
#[DataFixture(UserFixture::class)]
#[DataFixture(new BlaFixture(
name: 'Test123',
fileName: 'Test123'
))]
public function testFoo(): void
{
// cor code
}
#[DependFixture(BarFixture::class)]
class FooFixture implements FixtureInterface, FakerAware
{
// your code
}
#[DataFixture(new BarFixture('first'))]
#[DataFixture(BarFixture::class)]
public function testFoo(): void
{
// code
}