Created
November 10, 2015 19:37
-
-
Save openbrian/e5429eaf3600c1669696 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class curlTest | |
extends rimsTestCase | |
{ | |
/** | |
* @var string override to provide code coverage data from the server | |
*/ | |
protected $coverageScriptUrl; | |
/** | |
* @var boolean | |
*/ | |
private $collectCodeCoverageInformation; | |
public function __construct( $name = NULL, array $data = array(), $dataName = '' ) | |
{ | |
parent::__construct($name, $data, $dataName); | |
$this->coverageScriptUrl = buildUrl( '/phpunit_coverage.php' ); | |
} | |
public function run( PHPUnit_Framework_TestResult $result = NULL ) | |
{ | |
$this->testId = get_class($this) . '__' . $this->getName(); | |
if ($result === NULL) | |
{ | |
$result = $this->createResult(); | |
} | |
$this->collectCodeCoverageInformation = $result->getCollectCodeCoverageInformation(); | |
parent::run( $result ); | |
if ($this->collectCodeCoverageInformation) | |
{ | |
$coverage = new PHPUnit_Extensions_SeleniumCommon_RemoteCoverage | |
( $this->coverageScriptUrl | |
, $this->testId | |
); | |
$result->getCodeCoverage()->append( $coverage->get(), $this ); | |
} | |
return $result; | |
} | |
function getCookie() | |
{ | |
return 'PHPUNIT_SELENIUM_TEST_ID=' . $this->testId; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The parent class will buildUrl() and call the post method.