Integration test data fixture change proposal#373
Integration test data fixture change proposal#373bubasuma wants to merge 6 commits intomagento:masterfrom
Conversation
buskamuza
left a comment
There was a problem hiding this comment.
In general, looks good and brings good value. Thanks!
|
Interesting idea, but it has several problems:
|
|
@mykhailomatiola
|
|
There is an ability to use a class method as fixture. Could you add information about how it will work in such cases? Example of usage: |
|
@dhorytskyi /**
* @magentoDataFixture roleDataFixture {"role":{"name":"admin_role"}, "someVar": "value"}
*/
public function testGetRole()
{
}
public static function roleDataFixture(array $data)
{
}Or we could unpack the data array across function parameters. public static function roleDataFixture(array $role, string $someVar)
{
}But you will rarely need to customize function data fixture as they're written for your test only. |
|
@buskamuza @dhorytskyi
|
Problem
Actually there is no formal way to customize existing data fixture directly from the test case which leads to duplicated data fixtures.
Solution
Extend the format of data fixture annotation to support a second parameter which will be injected to the data fixture file to customize the fixture for a specific test scenario.
Requested Reviewers
@buskamuza