2015-09-11 38 views
2
配置文件名稱

我開始貝哈特與貝哈特3:如何進去FeatureContext

./bin/behat --suite=SuiteName --profile=profile_name 

是否有可能獲得當前貝哈特配置文件名稱中FeatureContext尤其是裏面BeforeSuiteScope

/** 
* @BeforeSuite 
*/ 
public static function beforeSuite(BeforeSuiteScope $scope) 
{ 
} 

回答

4

所以我發現蠻力強制方法,我知道它可能不是獲取配置文件名稱的最佳方式,但它可行。

$input = new ArgvInput($_SERVER['argv']); 
$profile = $input->getParameterOption(array('--profile', '-p')) ? : 'default'; 
var_dump($profile);die; 

而且ArgvInputSymfony\Component\Console\Input\ArgvInput

那CLI PARAMS解析如何做貝哈特。