Behat is for acceptance tests and phpunit is for unit (and functional)
tests. They cover different aspects of testing.
Acceptance tests are for validating that your user stories/use cases are
Unit tests are for testing the individual modules as a single unit (i.e.,
mock any dependencies the modules have), ensuring functionality is as
Functional tests are for testing that your modules are wired together and
that your application is functioning as expected, that all paths through
the application work as expected, etc.
Some say there is a fine line between Acceptance tests and Functional
tests, but Acceptance tests are meant to be written by non developers
(business analysts, QA, etc), and Behat's use of the Gherkin syntax aids in
providing that functionality.
Optimally, you should be using all three forms of testing.
On Tue, Jun 12, 2012 at 3:08 PM, Sören Martius <