Anyone has been using Behat with Zend Framework? Any examples on how to use both?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
My scenario was always stopping at the first step. I finally figured it out, there was a die or and exit somewhere in my code which was halting behat completety. So make sure your app doesn't contain any die or exit. Now it's working fine.
I got it working. It works with
PHPUnit
andZend_Test
so you can use all those niftyassertXYZ()
methods. First, make sure you've gotbehat
installed and available in your system$PATH
. I did the following:Now, create a directory structure like so:
The
features/application/ControllerTestCase.php
class is typical of aZend_Test
testing implementation:The
features/bootstrap/FeatureContext.php
class is what Behat needs to bootstrap itself:And now you can write features like
features/homepage.feature
:To run the tests,
cd
to the directory that contains thefeatures
folder, and typebehat
.Good luck!
Codeception has module for Zend Framework. It's much like Behat, but tests are written in PHP DSL and not in Gherkin.