Releases: samuelgfeller/test-traits
Releases · samuelgfeller/test-traits
6.2.1
6.2.0
Changes
- The function argument
$fieldsinDatabaseTableTestTraitandDatabaseTableExtensionTestTraitnow accepts a string$selectClausethat also can be a fields array making it a non-breaking change.
Now only the correct fields are selected where previously all were selected and the unwanted ones removed retroactively.
Commit: Changed database fields array to selectClause
6.1.3
Changes
- Non nullable container
6.1.2
Changes
- Better type hinting
- Trailing comma in multiline
6.1.1
Changes
- Adapted readme documentation TOC
6.1.0
Changes
- Added sql schema generator to setup the test database. Documentation.
6.0.1
Fixed
- Fixed return of incomplete fixture insert row
insertFixturedid not return all the columns that were inserted.
6.0.0
Changes
- Breaking change: Replaced fixture instance parameter by class string
- Instead of calling
insertFixture(new UserFixture()), the function is called with the fixture class string:insertFixture(UserFixture::class)
- Instead of calling
- Breaking change: Renamed
insertFixturestoinsertDefaultFixtureRecords
5.2.1
Changes
- Added argument unpacking to
insertFixture
The function can now be called the following ways:- Only with the default values:
$this->insertFixture(new UserFixture()); - Passing one set of values:
$this->insertFixture(new UserFixture(), ['name' => 'Bob']); - Passing different sets of values:
$this->insertFixture(new UserFixture(), ['name' => 'Frank'], ['name' => 'Alice']); - Passing different sets of values in one array:
$this->insertFixture(new UserFixture(), [['name' => 'Frank'], ['name' => 'Alice']]);
- Only with the default values:
- Breaking change: Added support for 2d arrays for
assertPartialJsonData(breaking: second parameter is no longer$responsebut thejsonDataarray to offer more flexibility)- If the server returns the following json:
['users' => [['id' => 1, 'name' => 'Bob'], ['id' => 2, 'name' => 'Frank']]], the assertPartialJsonData function can used as follows to assert the names:
$this->assertPartialJsonData([['name' => 'Bob'], ['name' => 'Frank']], $this->getJsonData($response)['users']);
- If the server returns the following json:
- Breaking change: Renamed
insertFixturestoinsertDefaultFixturesto prevent confusion