Skip to content

Commit

Permalink
Renamed insertFixtures to prevent confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgfeller committed Apr 9, 2024
1 parent a25afdf commit e98ea31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ The first parameter is the fixture object,
the second is optional and accepts arrays of attributes.

An array of attributes contains the data for one database row
e.g. `['field_name' => 'value', 'other_field_name' => 'other_value']`.
e.g.:
`['field_name' => 'value', 'other_field_name' => 'other_value']`.

Multiple rows can also be inserted with one function call.
Thanks to the argument unpacking operator,
Expand Down
8 changes: 4 additions & 4 deletions src/Trait/DatabaseSchemaTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function setUpDatabase(?string $schemaFile = null): void
$this->truncateTables();

if (!empty($this->fixtures)) {
$this->insertFixtures($this->fixtures);
$this->insertDefaultFixtures($this->fixtures);
}
}

Expand Down Expand Up @@ -113,9 +113,9 @@ protected function dropTables(): void
*
* @param string $sql The sql
*
* @return PDOStatement The statement
* @throws UnexpectedValueException
*
* @return PDOStatement The statement
*/
private function createQueryStatement(string $sql): PDOStatement
{
Expand All @@ -131,9 +131,9 @@ private function createQueryStatement(string $sql): PDOStatement
/**
* Import table schema.
*
* @return void
* @throws UnexpectedValueException
*
* @return void
*/
protected function importSchema(): void
{
Expand Down Expand Up @@ -202,7 +202,7 @@ protected function truncateTables(): void
*
* @return void
*/
protected function insertFixtures(array $fixtures): void
protected function insertDefaultFixtures(array $fixtures): void
{
foreach ($fixtures as $fixture) {
$object = new $fixture();
Expand Down

0 comments on commit e98ea31

Please sign in to comment.