include_once __DIR__ . '/PolyfillTestCase.php';
+use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage;
use PHPUnit\Framework\TestResult;
+use PHPUnit\Runner\BaseTestRunner;
/**
* Tests which involve interaction between the client and the server.
protected $collectCodeCoverageInformation;
protected $coverageScriptUrl;
+ /**
+ * @todo instead of overriding fail via _fail, implement Yoast\PHPUnitPolyfills\TestListeners\TestListenerDefaultImplementation
+ */
public static function _fail($message = '')
{
// save in a static var that this particular test has failed
* @param TestResult $result
* @return TestResult
* @throws Exception
+ *
+ * @todo instead of overriding run via _run, try to achieve this by implementing Yoast\PHPUnitPolyfills\TestListeners\TestListenerDefaultImplementation
*/
public function _run($result = NULL)
{
parent::_run($result);
if ($this->collectCodeCoverageInformation) {
- $coverage = new PHPUnit_Extensions_SeleniumCommon_RemoteCoverage(
+ $coverage = new RemoteCoverage(
$this->coverageScriptUrl,
$this->testId
);
{
$this->args = argParser::getArgs();
- $server = explode(':', $this->args['LOCALSERVER']);
+ $server = explode(':', $this->args['HTTPSERVER']);
if (count($server) > 1) {
- $this->client = new xmlrpc_client($this->args['URI'], $server[0], $server[1]);
+ $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]);
} else {
- $this->client = new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']);
+ $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']);
}
$this->client->setDebug($this->args['DEBUG']);
$this->client->request_compression = $this->request_compression;
$this->client->accepted_compression = $this->accepted_compression;
- $this->coverageScriptUrl = 'http://' . $this->args['LOCALSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['URI'] );
+ $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . '/' . str_replace( '/demo/server/server.php', 'tests/phpunit_coverage.php', $this->args['HTTPURI'] );
if ($this->args['DEBUG'] == 1)
ob_start();
return;
$out = ob_get_clean();
$status = $this->getStatus();
- if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR
- || $status == PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE) {
+ if ($status == BaseTestRunner::STATUS_ERROR
+ || $status == BaseTestRunner::STATUS_FAILURE) {
echo $out;
}
}
new xmlrpcval('hello world', 'string'),
));
$r = $this->send($m, 0, true);
- $this->assertContains('hello world', $r->raw_data);
+ $this->assertStringContainsString('hello world', $r->raw_data);
}
public function testSendTwiceSameMsg()