Releases: samuelgfeller/test-traits
Releases · samuelgfeller/test-traits
6.1.3
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
insertFixture
did 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
insertFixtures
toinsertDefaultFixtureRecords
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$response
but thejsonData
array 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
insertFixtures
toinsertDefaultFixtures
to prevent confusion