/**
  * setUp method for PHPUnit
  *
  */
 public function setUp()
 {
     // first we need the context and autoloading
     $this->initializeContext();
     // autoloading ready, continue
     $this->testBrowser = new sfTestFunctional(new sfBrowser(), new sfPhpunitTest($this));
     parent::setUp();
 }
 /**
  * @param PHPUnit_Framework_TestResult $result
  * @return PHPUnit_Framework_TestResult
  */
 public function run(PHPUnit_Framework_TestResult $result = null)
 {
     if ($result === null) {
         $result = $this->createResult();
     }
     $this->collectCodeCoverageInformation = $result->getCollectCodeCoverageInformation();
     parent::run($result);
     if ($this->collectCodeCoverageInformation && $this->coverageScriptUrl) {
         $session = $this->getSession('goutte');
         $url = sprintf('%s?PHPUNIT_SELENIUM_TEST_ID=%s', $this->coverageScriptUrl, $this->testId);
         $session->visit($url);
         $coverage = array();
         if ($content = $session->getPage()->getContent()) {
             $coverage = unserialize($content);
             if (is_array($coverage)) {
                 $coverage = $this->matchLocalAndRemotePaths($coverage);
             } else {
                 throw new Exception('Empty or invalid code coverage data received from url "' . $url . '"');
             }
         }
         $result->getCodeCoverage()->append($coverage, $this);
     }
     return $result;
 }
 public function tearDown()
 {
     $this->_tearDownMapping();
     parent::tearDown();
 }
 /**
  * Reset started sessions.
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->getMink()->resetSessions();
 }