I'm currently working on a package of Laravel that will launch behats tests directly from our browser. this is a personal project.
I use the Process Component Symfony to execute various commands. However, it can not execute the command Behat and returns me this error:
vendor / bin / Behat "failed.
Exit Code: 255 (Unknown error) Working directory: / Applications / MAMP / htdocs / Package / public
Output: ================ Parse error: parse error, expecting '&' 'or
"variable (T_VARIABLE)' 'in / Applications / MAMP / htdocs / Package / vendor /laravel/framework/src/Illuminate/Foundation/helpers.php on line 475
Error Output: ================
In short, he refused to execute all commands Behat. Here the use of the command in the controller of my package.
<? Php
namespace Nkweb\BehatWeb\Http\Controllers;
use App\Http\Controllers\Controller;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
class BehatWebController extends Controller
{
public function launchBehat()
{
$command = base_path('vendor/bin/Behat');
$process = new Process($command);
try {
$process->mustRun();
$outputs = explode("\n", $process->getOutput());
} Catch (ProcessFailedException $e) {
return $e->getMessage();
}
return view('behatweb::content.init', ['outputs' => $outputs]);
}
}
I searched google and returned in every way but I could not find anything about it. I really need your help :(