Igo*_*nko 2 php autotest behat mink
我开始说
./bin/behat --suite=SuiteName --profile=profile_name
Run Code Online (Sandbox Code Playgroud)
是否有可能在FeatureContext中获取当前的behat配置文件名称,尤其是内部 BeforeSuiteScope
/**
* @BeforeSuite
*/
public static function beforeSuite(BeforeSuiteScope $scope)
{
}
Run Code Online (Sandbox Code Playgroud)
所以我发现了暴力方法,我知道它可能不是获取配置文件名称的最佳方式,但它有效.
$input = new ArgvInput($_SERVER['argv']);
$profile = $input->getParameterOption(array('--profile', '-p')) ? : 'default';
var_dump($profile);die;
Run Code Online (Sandbox Code Playgroud)
而且ArgvInput
是Symfony\Component\Console\Input\ArgvInput
这就是cli params解析如何完成.