I have been struggling for a while with the idea of TDD and in particular BDD. I have wanted to use it and the cool stuff like Cucumber is only available in Ruby, but I use Symfony. I don't use the pretty new Symfony2, but instead regular old Symfony1.4. All of the cool Symfony2 kids are using Behat. The even cooler kids are using Behat+Mink+Zombie. I really wanted that to be me so I set forth, but my journey wasn't without problems, so look out for these issues:
The Issues (and fixes)
Error Messages
- PHP Fatal error: Uncaught exception 'Behat\Mink\Exception\DriverException' with message 'Could not load resource
- Argument #2 of PHPUnit_Framework_Assert::assertContains() must be a array, iterator or string
Issues Without an Error
- $page->getText() doesn't work.
- zombie.visit(url) doesn't error, but doesn't run the stuff inside the closure.
Symfony User Agent Check
Zombie Test Script
Obviously you will want to put in your local url. Also, if this works, remove runScripts. If it fails without runScripts, the issue is with a script you are including. Try to get rid of third party hosted scripts.
Enjoy! Tomorrow I will post an installation tutorial for OSX+Macports. Look out for it!
0 comments:
Post a Comment