-
Notifications
You must be signed in to change notification settings - Fork 78
Updating bootstrap to get rid of Di and use ServiceManager #19
Conversation
tests/bootstrap.php
Outdated
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.
Can you use TestConfiguration.php.dist or TestConfiguration.php for this?
Also, I'd stop instantiating the service manager here and instead use something like https://github.com/Ocramius/OcraDiCompiler/blob/master/tests/OcraDiCompilerTest/ServiceManagerTestCase.php
|
@SocalNick This pull request has been open for two months. Do you see any opportunity to look at @Ocramius his comment? |
Conflicts: tests/bootstrap.php
|
I'm not sure if I understand why we would need the $config in TestConfiguration.php.dist? There isn't much more besides modules and module_paths. Furthermore, this is really a jumping off point. If your testing needs are more complex, you likely have your own bootstrap. As for @Ocramius point about instantiating a new Service Manager, I looked at the OcraDiCompiler test suite and none of the tests cases extend ServiceManagerTestCase. Either way, I'm leaning more towards the approach @EvanDotPro took with this module: https://github.com/EvanDotPro/SpeckCart/blob/master/tests/Bootstrap.php Should I change to an OOP bootstrap and file another PR? |
|
It is not relevant to have an OOP bootstrap or something functional. It is I used OcraDiCompiler's test util (it is not really a test case) in the Marco Pivetta On 3 October 2012 03:15, Nicholas Calugar notifications@github.com wrote:
|
|
Question: do we want to continue with this route, or go with the one started in ZF-Commons/ZfcBase? The latter feels easier to me, and addresses the concerns @Ocramius mentions. Thoughts? |
|
@weierophinney ZfcBase doesn't yet solve this either: https://github.com/ZF-Commons/ZfcBase/blob/52a52c23f82242ce7ff0fcba08488dc52180ee13/tests/Bootstrap.php#L54-57 (currently) |
|
Sorry for not being able to get to this in a timely fashion. Work has been crazy. I'm hoping to tackle some OSS stuff during ZendCon when I don't have work duties to attend to. @weierophinney are we going to have another late night hack session like last year?! |
|
@SocalNick ABSOLUTELY! :) |
|
Friendly reminder about this one since it's been 3 months. :) It would be nice to clean up the DI stuff to reduce confusion and provide a good jumping off point for newcomers writing module tests. |
|
Yep, would really like a good boostrap to use for my module unit tests! I have looked at a few of the solutions so far, but I'm still not sure how best to unit test a module with dependencies on other modules. |
|
@lboynton I've been using a variation of @weierophinney test bootstrap: https://github.com/weierophinney/PhlySimplePage/tree/master/test |
|
Thanks, will take a look! On 11 March 2013 16:12, Nicholas Calugar notifications@github.com wrote:
|
|
Wow, how is this still open?! Took me back reading the thread, hope everyone is doing well! |
No description provided.