Ejemplo n.º 1
0
 /**
  * @see LiveTest\Config\Tags\TestSuite.Base::doProcess()
  */
 protected function doProcess(\LiveTest\Config\TestSuite $config, $parameters)
 {
     $config->getCurrentSession()->doNotInherit();
     foreach ($parameters as $file) {
         $config->getCurrentSession()->includePageRequests(Request::createRequestsFromParameters(file($config->getBaseDir() . '/' . $file), $config->getDefaultDomain()));
     }
 }
Ejemplo n.º 2
0
 /**
  * Returns the base directory of the config file.
  *
  * @return string
  */
 public function getBaseDir()
 {
     if (is_null($this->baseDir)) {
         return $this->parentConfig->getBaseDir();
     }
     return $this->baseDir;
 }
Ejemplo n.º 3
0
 /**
  * @see LiveTest\Config\Tags\TestSuite.Base::doProcess()
  */
 protected function doProcess(\LiveTest\Config\TestSuite $config, $parameters)
 {
     foreach ($parameters as $file) {
         $yaml = new Yaml($config->getBaseDir() . '/' . $file);
         $this->getParser()->parse($yaml->toArray(), $config);
     }
 }
Ejemplo n.º 4
0
 /**
  * @see LiveTest\Config\Tags\TestSuite.Base::doProcess()
  */
 protected function doProcess(TestSuiteConfig $config, $sessionFiles)
 {
     foreach ($sessionFiles as $sessionFile) {
         $yaml = new Yaml($config->getBaseDir() . '/' . $sessionFile);
         $this->getParser()->parse($yaml->toArray(), $config);
     }
 }
Ejemplo n.º 5
0
 protected function doProcess(\LiveTest\Config\TestSuite $config, $parameters)
 {
     foreach ($parameters as $file) {
         // @todo base dir must be set. Would be a conflict if the standard config is overwritten.
         $filename = $config->getBaseDir() . DIRECTORY_SEPARATOR . $file;
         try {
             // @todo yaml dependency must be replaced. It must be possible to use xml as well.
             $yamlFile = new Yaml($filename);
         } catch (InvalidArgumentException $e) {
             throw new ConfigurationException('The included testsuite configuration file ("' . $filename . '") was not found.', null, $e);
         }
         $this->getParser()->parse($yamlFile->toArray(), $config);
     }
 }
Ejemplo n.º 6
0
 /**
  * @see LiveTest\Config\Tags\TestSuite.Base::doProcess()
  *
  * @fixme does not work if no Pages are added
  */
 protected function doProcess(\LiveTest\Config\TestSuite $config, $testsuites)
 {
     foreach ($testsuites as $testsuite) {
         $filename = $testsuite['filename'];
         unset($testsuite['filename']);
         // @todo must be part of base library
         if (strpos($filename, '/') > 0) {
             $filename = $config->getBaseDir() . '/' . $filename;
         }
         try {
             $yaml = new Yaml($filename);
         } catch (\Exception $e) {
             throw new ConfigurationException("Error parsing included testsuite '" . $filename . "': " . $e->getMessage(), null, $e);
         }
         $testSuiteConfig = new TestSuite($config->getCurrentSession(), $config);
         $testSuiteConfig->setDefaultDomain($config->getDefaultDomain());
         $parameters = $yaml->toArray();
         $this->getParser()->parse($parameters, $testSuiteConfig);
         $this->getParser()->parse($testsuite, $testSuiteConfig);
     }
 }