PHPSpec problems?

Asked by Dereck Haskins

Have you had other complaints withe PHPSpec?

Short story - I got the wishlist app working on Linux. But the test.php is not working due to some problems with PHPSpec. Are these known? PHPSpec seems to have changed the signatures of the method calls. This is relatively unimportant but I plan to do more work with Korlibri and if you guys are using PHPSpec daily I should know since you might be using in other tests.

Thanks,
Dereck

Question information

Language:
English Edit question
Status:
Solved
For:
Kolibri Edit question
Assignee:
No assignee Edit question
Solved by:
Frode Danielsen
Solved:
Last query:
Last reply:
Revision history for this message
Best Frode Danielsen (frode-danielsen) said :
#1

Ah, the test framework support is quite outdated in the repo. Sorry about not mentioning this before!

We started using phpspec in early 2009. Then we discovered that it seemed to be a dead project. Like their Google Code page now says: "As of 11 January 2008, PHPSpec 0.2.3 has been available for download.".

So we switched to phpunit on our biggest project with Kolibri, and started porting over tests. phpunit had support for both story/scenarios and Selenium for integration testing as well as unit tests, and it worked well for us. Then phpunit announced they were dropping their story/scenario support, and it is now deprecated.

We are still using phpunit and will continue to do so for unit tests, but will probably start using Behat (http://behat.org/) for integration testing (which has been suggested by phpunit devs).

When we have the time we'll make sure to update the repo with more current testing support. But as you can probably guess we're a bit tired of porting tests after dead and/or deprecated projects and features :)

A brief rundown of our current phpunit setup is this:
- no more test.php, and a "tests" directory instead of "specs", with "integration" and "unit" sub directories
- a bootstrap.php file which sets up necessary environment variables and loads the config
- a phpunit.xml file which is loaded by phpunit automatically and makes sure the bootstrap.php file is executed

If you need help getting started with testing properly before we get the repo updated, I can help you with the bootstrap.php and phpunit.xml files at least. Just give me an email or something to which I should send it.

Revision history for this message
Dereck Haskins (cmonster) said :
#2

Thanks - this was a good description of the issue. I spent maybe three hours and couldn't make sense of PHPSpec's errors, so I thought I'd ask before banging my head further.

No need to rush on the updating of the Repo, as this little bit -

>>

A brief rundown of our current phpunit setup is this:
- no more test.php, and a "tests" directory instead of "specs", with "integration" and "unit" sub directories
- a bootstrap.php file which sets up necessary environment variables and loads the config
- a phpunit.xml file which is loaded by phpunit automatically and makes sure the bootstrap.php file is executed

>>

is all I need to understand what you are doing.

I'm working to clean-up a large project that is currently a mess of independent php pages (another guy worked on it before me) and I'm now going to port it to Kolibri. I'll probably ask more questions, but so far everything looks great. I really appreciate the phpunit and behat info for going forward.

Dereck