Skip to content
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

Allow tests to override DI config for a single test by using a custom annotation #8724

Closed
diosmosis opened this issue Sep 7, 2015 · 0 comments
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@diosmosis
Copy link
Member

Sometimes it's necessary to override DI config not just for a whole test case, but for an individual test. In this case, provideContainerConfig() can be used, but it gets messy since you have to vary it's behavior based on the running test.

We could allow individual tests to override DI w/ a custom test annotation @provideContainerConfig, eg:

/**
 * @dataProvider getDataForTest
 * @provideContainerConfig getContainerConfigForThisTest
public function test_this_AndThat()
{
    // ...
}
@diosmosis diosmosis added the c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. label Sep 7, 2015
@diosmosis diosmosis added this to the 3.0.0 milestone Sep 7, 2015
@mattab mattab modified the milestones: Mid term, 3.0.0 Dec 8, 2015
@mattab mattab closed this as completed Jul 8, 2016
@mattab mattab added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants