-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration test data fixture change proposal #373
base: master
Are you sure you want to change the base?
Integration test data fixture change proposal #373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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