for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Behat\Behat\Context\Context;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;
class FeatureContext implements Context
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* @var string
*/
private $workingDir;
private $phpBin;
* @var Process
private $process;
public function __construct()
$phpFinder = new PhpExecutableFinder();
if (false === $php = $phpFinder->find()) {
throw new \RuntimeException('Unable to find the PHP executable. The testsuite cannot run.');
}
$this->phpBin = $php;
* Prepares test folders in the temporary directory.
*
* @BeforeScenario
public function prepareTestFolders()
$dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'behat' . DIRECTORY_SEPARATOR . md5(microtime() . rand(0, 10000));
mkdir($dir . '/features/bootstrap', 0777, true);
$this->workingDir = $dir;
$this->process = new Process(null);
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$this->process->setTimeout(20);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.