Skip to content
This repository was archived by the owner on Dec 7, 2019. It is now read-only.

Conversation

@SocalNick
Copy link
Contributor

No description provided.

Copy link
Member

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

@Freeaqingme
Copy link
Member

@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
@SocalNick
Copy link
Contributor Author

@Freeaqingme @Ocramius

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?

@Ocramius
Copy link
Member

Ocramius commented Oct 3, 2012

It is not relevant to have an OOP bootstrap or something functional. It is
anyway (to me) really important to be able to have a fresh ServiceManager
instantiated as if we were in application context. That makes integration
tests possible, while the current setup does not guarantee insulation.

I used OcraDiCompiler's test util (it is not really a test case) in the
past, I currently use it in my company's modules only.

Marco Pivetta

http://twitter.com/Ocramius

http://marco-pivetta.com

On 3 October 2012 03:15, Nicholas Calugar notifications@github.com wrote:

@Freeaqingme https://github.com/Freeaqingme @Ocramiushttps://github.com/Ocramius

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 https://github.com/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 @EvanDotProhttps://github.com/EvanDotProtook with this module:
https://github.com/EvanDotPro/SpeckCart/blob/master/tests/Bootstrap.php

Should I change to an OOP bootstrap and file another PR?


Reply to this email directly or view it on GitHubhttps://github.com//pull/19#issuecomment-9092837.

@weierophinney
Copy link
Member

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?

@Ocramius
Copy link
Member

@SocalNick
Copy link
Contributor Author

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?!

@weierophinney
Copy link
Member

@SocalNick ABSOLUTELY! :)

@cgmartin
Copy link
Contributor

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.

@lboynton
Copy link

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.

@SocalNick
Copy link
Contributor Author

@lboynton I've been using a variation of @weierophinney test bootstrap: https://github.com/weierophinney/PhlySimplePage/tree/master/test

@lboynton
Copy link

Thanks, will take a look!

On 11 March 2013 16:12, Nicholas Calugar notifications@github.com wrote:

@lboynton https://github.com/lboynton I've been using a variation of
@weierophinney https://github.com/weierophinney test bootstrap:
https://github.com/weierophinney/PhlySimplePage/tree/master/test


Reply to this email directly or view it on GitHubhttps://github.com//pull/19#issuecomment-14722466
.

@SocalNick
Copy link
Contributor Author

Wow, how is this still open?! Took me back reading the thread, hope everyone is doing well!

@SocalNick SocalNick closed this Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants