Пример #1
0
 public function testHandleResult()
 {
     $this->listener = new Sleep('', new Dispatcher());
     $this->listener->init(1);
     $test = new Test('', '');
     $response = new MockUp();
     $timer = new Timer();
     $this->listener->handleConnectionStatus(new ConnectionStatus(ConnectionStatus::SUCCESS, Request::create(new Uri('http://www.example.com'))));
     $this->assertGreaterThanOrEqual($this->sleepTime, $timer->stop());
 }
Пример #2
0
 public function request(Request $request)
 {
     $method = $request->getMethod();
     $parameters = $request->getParameters();
     $this->setUri($request->getUri());
     if (!strcasecmp($method, Request::GET)) {
         $this->setParameterGet($parameters);
     } else {
         if (!strcasecmp($method, Request::POST)) {
             $this->setParameterPost($parameters);
         }
     }
     $this->setTimeout(1);
     $timer = new Timer();
     $response = parent::request($method);
     $duration = $timer->stop();
     return new \Base\Http\Response\Zend($response, $duration);
 }
Пример #3
0
 /**
  * This function runs all test sets defined in the properties file.
  *
  * @notify LiveTest.Run.PostRun
  * @notify LiveTest.Run.PreRun
  */
 public function run()
 {
     $this->eventDispatcher->simpleNotify('LiveTest.Run.PreRun', array('properties' => $this->properties));
     // @todo move timer to runner.php
     $timer = new Timer();
     foreach ($this->properties->getTestSets() as $sessionName => $testSets) {
         foreach ($testSets as $testSet) {
             $this->runTestSet($testSet, $sessionName);
         }
     }
     $information = new Information($timer->stop(), $this->properties->getDefaultDomain());
     $this->eventDispatcher->simpleNotify('LiveTest.Run.PostRun', array('information' => $information));
 }