예제 #1
0
 public function testGetArguments()
 {
     $expectedArguments = array('arg1' => 'value1', 'arg2' => 'value2', Magento_Performance_Scenario::ARG_USERS => 1, Magento_Performance_Scenario::ARG_LOOPS => 1);
     $this->assertEquals($expectedArguments, $this->_object->getArguments());
 }
예제 #2
0
 /**
  * Build and return scenario execution command and arguments for it, compatible with the getopt() "long options"
  * @link http://www.php.net/getopt
  *
  * @param Magento_Performance_Scenario $scenario
  * @return array
  */
 protected function _buildScenarioCmd(Magento_Performance_Scenario $scenario)
 {
     $command = 'php -f %s --';
     $arguments = array($scenario->getFile());
     foreach ($scenario->getArguments() as $paramName => $paramValue) {
         $command .= " --{$paramName} %s";
         $arguments[] = $paramValue;
     }
     return array($command, $arguments);
 }
예제 #3
0
 /**
  * Build and return scenario execution command and arguments for it
  *
  * @param Magento_Performance_Scenario $scenario
  * @param string|null $reportFile
  * @return array
  */
 protected function _buildScenarioCmd(Magento_Performance_Scenario $scenario, $reportFile = null)
 {
     $command = 'jmeter -n -t %s';
     $arguments = array($scenario->getFile());
     if ($reportFile) {
         $command .= ' -l %s';
         $arguments[] = $reportFile;
     }
     foreach ($scenario->getArguments() as $key => $value) {
         $command .= ' %s';
         $arguments[] = "-J{$key}={$value}";
     }
     return array($command, $arguments);
 }