megclaypool of Rootid
1/10/2019 - 11:54 PM

How to use PHPUnit assertions in Behat FeatureContext

  1. composer require --dev phpunit/phpunit
  2. Below all the "use" statements at the beginning of the FeatureContext.php, just add the line
    require_once __DIR__.'/../../vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';

Then you can use any of the PHPUnit assertions :)