Beispiel #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()));
     }
 }
Beispiel #2
0
 public function testCreatePageRequestsFromParameters()
 {
     $includedPages = array('http://www.example.com/', 'http://www.phphatesme.com/');
     $config = new TestSuite();
     $config->addSession('default', new Session());
     $config->setCurrentSession('default');
     $pageRequestsToInclude = Request::createRequestsFromParameters($includedPages);
     $config->getCurrentSession()->includePageRequests($pageRequestsToInclude);
     $pageRequests = $config->getCurrentSession()->getPageRequests();
     $this->assertEquals(count($includedPages), count($pageRequests));
 }
Beispiel #3
0
 /**
  * @see LiveTest\Config\Tags\TestSuite.Base::doProcess()
  */
 protected function doProcess(\LiveTest\Config\TestSuite $config, $parameters)
 {
     $requests = SymfonyRequest::createRequestsFromParameters($parameters, $config->getDefaultDomain());
     if ($config->hasSessions()) {
         $config->getCurrentSession()->includePageRequests($requests);
     } else {
         throw new ConfigurationException('You can not use the Page tag outside a session tag.');
     }
 }
 /**
  * @see LiveTest\Config\Tags\TestSuite.Base::doProcess()
  */
 protected function doProcess(TestSuiteConfig $config, $sessioNames)
 {
     $currentSession = $config->getCurrentSession();
     foreach ($sessioNames as $sessionName) {
         if ($config->hasSession($sessionName)) {
             $currentSession->extendSession($config->getSession($sessionName));
         } else {
             throw new ConfigurationException("Can't extend an undefined session (" . $sessionName . "). Sessions must be defined before they can be used.");
         }
     }
 }
Beispiel #5
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);
     }
 }
Beispiel #6
0
 /**
  * @see LiveTest\Config\Tags\TestSuite.Base::doProcess()
  */
 protected function doProcess(\LiveTest\Config\TestSuite $config, $parameters)
 {
     $config->getCurrentSession()->excludePageRequests(Request::createRequestsFromParameters($parameters, $config->getDefaultDomain()));
 }