1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-14 19:02:40 +01:00
phorge-arcanist/src/unit/engine/ArcanistTestResultParser.php
Joshua Spence ef18ae08eb Don't explicitly name abstract base classes
Summary:
Ref T5655. It is superfluous to include "base" in the name of an abstract base class. Furthermore, it is not done consistently within the code base.

In order to retain compatibility with external code, I have kept the `ArcanistBaseWorkflow` class (which trivially extends from `ArcanistWorkflow`), but it is now deprecated and should output a warning message. Similarly for `ArcanistBaseUnitTestEngine`.

Test Plan: Created a workflow which extends from `ArcanistBaseWorkflow`. Executed the workflow and saw a deprecation warning.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin, aurelijus

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D9983
2014-07-22 07:49:15 +10:00

48 lines
1 KiB
PHP

<?php
/**
* Abstract base class for test result parsers.
*/
abstract class ArcanistTestResultParser {
protected $enableCoverage;
protected $projectRoot;
protected $coverageFile;
protected $stderr;
public function setEnableCoverage($enable_coverage) {
$this->enableCoverage = $enable_coverage;
return $this;
}
public function setProjectRoot($project_root) {
$this->projectRoot = $project_root;
return $this;
}
public function setCoverageFile($coverage_file) {
$this->coverageFile = $coverage_file;
return $this;
}
public function setAffectedTests($affected_tests) {
$this->affectedTests = $affected_tests;
return $this;
}
public function setStderr($stderr) {
$this->stderr = $stderr;
return $this;
}
/**
* Parse test results from provided input and return an array of
* @{class:ArcanistUnitTestResult}.
*
* @param string Path to test.
* @param string String containing test results.
* @return array
*/
abstract public function parseTestResults($path, $test_results);
}