/** * @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); } }
/** * @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); } }
public function testUnknownTag() { $config = new TestSuite(); $config->setBaseDir(__DIR__ . '/fixtures/'); $configYaml = new Yaml(__DIR__ . '/fixtures/badtestsuite.yml'); $parser = new Parser('LiveTest\\Config\\Tags\\TestSuite\\'); $this->setExpectedException('LiveTest\\Config\\Parser\\UnknownTagException'); $parsedConfig = $parser->parse($configYaml->toArray(), $config); }
/** * @todo check if the directory really exists * @see LiveTest\Config\Tags\Config.Base::doProcess() */ protected function doProcess(ConfigConfig $config, $packages) { foreach ($packages as $key => $package) { $packageName = $package . '/package.yml'; $yaml = new Yaml($packageName); $packageArray = $yaml->toArray(); if (array_key_exists('NamespaceRoot', $packageArray)) { $this->namespaceRoots[] = $package . DIRECTORY_SEPARATOR . $packageArray['NamespaceRoot']; unset($packageArray['NamespaceRoot']); } $this->getParser()->parse($packageArray, $config); } spl_autoload_register(array($this, 'autoload')); }
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); } }
/** * @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); } }
/** * Creates a properties object that was created using a yaml file. * * @todo is this method neccessary? If yes: Where to put it? At the moment it is only used to make testing easier * * @param String $filename The file name of the yaml file * @param Uri $defaultUri The default uri */ public static function createByYamlFile($filename, Uri $defaultUri, Dispatcher $eventDispatcher) { try { $yamlConfig = new Yaml($filename); } catch (\Zend\Config\Exception $e) { throw new ConfigurationException('Unable to load test suite yaml file (filename: ' . $filename . ')'); } $testSuiteConfig = new TestSuite(); $testSuiteConfig->setBaseDir(dirname($filename)); $testSuiteConfig->setDefaultDomain($defaultUri); $parser = new Parser('LiveTest\\Config\\Tags\\TestSuite\\'); try { $testSuiteConfig = $parser->parse($yamlConfig->toArray(), $testSuiteConfig); } catch (UnknownTagException $e) { throw new ConfigurationException('Error parsing testsuite configuration (' . $filename . '): ' . $e->getMessage(), null, $e); } $testSuiteConfig->resolveSessionGroups(); $eventDispatcher->simpleNotify('LiveTest.TestRun.Properties.PostTestSuiteInit', array('config' => $testSuiteConfig)); return new self($testSuiteConfig, $defaultUri); }
private function getTestSuiteConfig() { $yaml = new Yaml(__DIR__ . '/Fixtures/testsuite.yml', true); return $yaml->toArray(); }