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
    }
`yaml
# config/packages/data_fixtures_php_unit.yaml
data_fixtures_php_unit:
  faker:
    locale: 'de_DE' # optional - defaults to en_EN
    providers:
      - 'App\Tests\Faker\Bundeslaender' # optional - defaults to empty array
`yaml
# config/packages/data_fixtures_php_unit.yaml
data_fixtures_php_unit:
  faker: