class FileFixtureProvider
    extends Base

Faker provider that generates fixtures from local DDL files.

Methods§

public function __construct(
    Generator $faker,
    string $ddlPath,
    ?TypeMapperInterface $typeMapper = null,
    ?HydratorInterface $hydrator = null,
    string $dialect = PlatformFactory::DRIVER_MYSQL,
)

Parameters

$fakerGenerator
$ddlPathstring
$typeMapper?TypeMapperInterface
$hydrator?HydratorInterface
$dialectstringSQL dialect ('mysql' or 'sqlite')
Calls 7
public function fixture<T of object>(
    string $tableName,
    array<string, mixed> $overrides = [],
    class-string<T>|null $className = null,
): ($className is null ? array<string, mixed> : T)

Generate a fixture from a DDL file.

Parameters

$tableNamestringTable name (e.g., "users")
$overridesarray<string, mixed>Override values
$classNameclass-string<T>|nullDeserialization target class

Returns

($className is null ? array<string, mixed> : T)

Throws

RuntimeException
Test cases 7
Calls 3
public function getTableNames(): list<string>

Get list of available table names.

Returns

list<string>
Test cases 1
Calls 1
public function registerSchema(string $createTableSql): void

Manually register a schema.

Parameters

$createTableSqlstring
Test cases 2
Calls 2
public function getFixtureGenerator(): FixtureGenerator

Get the underlying fixture generator.

Test cases 1

Private surface 2§

Implementation details, listed for orientation only.

private FixtureGenerator $fixtureGenerator
private array<string, TableSchema> $schemas = []

Test cases 17§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 17