예제 #1
0
 /**
  * This function creates and initializes the test case object using the init method.
  *
  * @param Test $test
  * @return TestCase
  */
 private function getInitializedTestCase(Test $test)
 {
     $testCaseName = $test->getClassName();
     if (class_exists($testCaseName)) {
         $testCaseObject = new $testCaseName();
     } else {
         // @todo use a specialized exception
         throw new \Exception('Class not found (' . $testCaseName . '). ');
     }
     \LiveTest\Functions::initializeObject($testCaseObject, $test->getParameter());
     return $testCaseObject;
 }
예제 #2
0
 /**
  * This function is used to register listeners using a global configuration file
  *
  * @param ConfigConfig $config
  * @param string $runId
  */
 public function registerByConfig(ConfigConfig $config, $runId)
 {
     foreach ($config->getListeners() as $listener) {
         $className = $listener['className'];
         if (!class_exists($className)) {
             throw new \LiveTest\ConfigurationException('Listener not found (' . $className . ').');
         }
         $listenerObject = new $className($runId, $this);
         \LiveTest\Functions::initializeObject($listenerObject, $listener['parameters']);
         $this->connectListener($listenerObject, $listener['priority']);
     }
 }
예제 #3
0
 /**
  * Creates format class.
  */
 private function initFormat($formatConfig)
 {
     $formatClass = $formatConfig['class'];
     $this->format = new $formatClass();
     $parameter = array();
     if (array_key_exists('parameter', $formatConfig)) {
         $parameter = $formatConfig['parameter'];
     }
     \LiveTest\Functions::initializeObject($this->format, $parameter);
 }