mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
Rename ArcanistPhutilTestCase to PhutilTestCase and Remove ArcanistTestCase
Summary: Ref T7977. The `ArcanistTestCase` class is pointless and can be replaced by `ArcanistPhutilTestCase`. Furthermore, it sorta makes sense to just rename `ArcanistPhutilTestCase` to `PhutilTestCase`. Depends on D12664 and D12666. Test Plan: `arc unit` Reviewers: avivey, #blessed_reviewers, epriestley Reviewed By: avivey, #blessed_reviewers, epriestley Subscribers: aurelijus, Korvin, epriestley Maniphest Tasks: T7977 Differential Revision: https://secure.phabricator.com/D12665
This commit is contained in:
parent
399f040018
commit
753705b2c5
24 changed files with 67 additions and 71 deletions
|
@ -138,10 +138,6 @@ phutil_register_library_map(array(
|
||||||
'ArcanistPhpunitTestResultParser' => 'unit/parser/ArcanistPhpunitTestResultParser.php',
|
'ArcanistPhpunitTestResultParser' => 'unit/parser/ArcanistPhpunitTestResultParser.php',
|
||||||
'ArcanistPhrequentWorkflow' => 'workflow/ArcanistPhrequentWorkflow.php',
|
'ArcanistPhrequentWorkflow' => 'workflow/ArcanistPhrequentWorkflow.php',
|
||||||
'ArcanistPhutilLibraryLinter' => 'lint/linter/ArcanistPhutilLibraryLinter.php',
|
'ArcanistPhutilLibraryLinter' => 'lint/linter/ArcanistPhutilLibraryLinter.php',
|
||||||
'ArcanistPhutilTestCase' => 'unit/engine/phutil/ArcanistPhutilTestCase.php',
|
|
||||||
'ArcanistPhutilTestCaseTestCase' => 'unit/engine/phutil/testcase/ArcanistPhutilTestCaseTestCase.php',
|
|
||||||
'ArcanistPhutilTestSkippedException' => 'unit/engine/phutil/testcase/ArcanistPhutilTestSkippedException.php',
|
|
||||||
'ArcanistPhutilTestTerminatedException' => 'unit/engine/phutil/testcase/ArcanistPhutilTestTerminatedException.php',
|
|
||||||
'ArcanistPhutilXHPASTLinter' => 'lint/linter/ArcanistPhutilXHPASTLinter.php',
|
'ArcanistPhutilXHPASTLinter' => 'lint/linter/ArcanistPhutilXHPASTLinter.php',
|
||||||
'ArcanistPhutilXHPASTLinterTestCase' => 'lint/linter/__tests__/ArcanistPhutilXHPASTLinterTestCase.php',
|
'ArcanistPhutilXHPASTLinterTestCase' => 'lint/linter/__tests__/ArcanistPhutilXHPASTLinterTestCase.php',
|
||||||
'ArcanistPuppetLintLinter' => 'lint/linter/ArcanistPuppetLintLinter.php',
|
'ArcanistPuppetLintLinter' => 'lint/linter/ArcanistPuppetLintLinter.php',
|
||||||
|
@ -170,7 +166,6 @@ phutil_register_library_map(array(
|
||||||
'ArcanistSubversionAPI' => 'repository/api/ArcanistSubversionAPI.php',
|
'ArcanistSubversionAPI' => 'repository/api/ArcanistSubversionAPI.php',
|
||||||
'ArcanistSummaryLintRenderer' => 'lint/renderer/ArcanistSummaryLintRenderer.php',
|
'ArcanistSummaryLintRenderer' => 'lint/renderer/ArcanistSummaryLintRenderer.php',
|
||||||
'ArcanistTasksWorkflow' => 'workflow/ArcanistTasksWorkflow.php',
|
'ArcanistTasksWorkflow' => 'workflow/ArcanistTasksWorkflow.php',
|
||||||
'ArcanistTestCase' => 'infrastructure/testing/ArcanistTestCase.php',
|
|
||||||
'ArcanistTestResultParser' => 'unit/parser/ArcanistTestResultParser.php',
|
'ArcanistTestResultParser' => 'unit/parser/ArcanistTestResultParser.php',
|
||||||
'ArcanistTestXHPASTLintSwitchHook' => 'lint/linter/__tests__/ArcanistTestXHPASTLintSwitchHook.php',
|
'ArcanistTestXHPASTLintSwitchHook' => 'lint/linter/__tests__/ArcanistTestXHPASTLintSwitchHook.php',
|
||||||
'ArcanistTextLinter' => 'lint/linter/ArcanistTextLinter.php',
|
'ArcanistTextLinter' => 'lint/linter/ArcanistTextLinter.php',
|
||||||
|
@ -204,6 +199,10 @@ phutil_register_library_map(array(
|
||||||
'NoseTestEngine' => 'unit/engine/NoseTestEngine.php',
|
'NoseTestEngine' => 'unit/engine/NoseTestEngine.php',
|
||||||
'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php',
|
'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php',
|
||||||
'PhpunitTestEngineTestCase' => 'unit/engine/__tests__/PhpunitTestEngineTestCase.php',
|
'PhpunitTestEngineTestCase' => 'unit/engine/__tests__/PhpunitTestEngineTestCase.php',
|
||||||
|
'PhutilTestCase' => 'unit/engine/phutil/PhutilTestCase.php',
|
||||||
|
'PhutilTestCaseTestCase' => 'unit/engine/phutil/testcase/PhutilTestCaseTestCase.php',
|
||||||
|
'PhutilTestSkippedException' => 'unit/engine/phutil/testcase/PhutilTestSkippedException.php',
|
||||||
|
'PhutilTestTerminatedException' => 'unit/engine/phutil/testcase/PhutilTestTerminatedException.php',
|
||||||
'PhutilUnitTestEngine' => 'unit/engine/PhutilUnitTestEngine.php',
|
'PhutilUnitTestEngine' => 'unit/engine/PhutilUnitTestEngine.php',
|
||||||
'PhutilUnitTestEngineTestCase' => 'unit/engine/__tests__/PhutilUnitTestEngineTestCase.php',
|
'PhutilUnitTestEngineTestCase' => 'unit/engine/__tests__/PhutilUnitTestEngineTestCase.php',
|
||||||
'PytestTestEngine' => 'unit/engine/PytestTestEngine.php',
|
'PytestTestEngine' => 'unit/engine/PytestTestEngine.php',
|
||||||
|
@ -216,13 +215,13 @@ phutil_register_library_map(array(
|
||||||
'ArcanistAmendWorkflow' => 'ArcanistWorkflow',
|
'ArcanistAmendWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistAnoidWorkflow' => 'ArcanistWorkflow',
|
'ArcanistAnoidWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistBackoutWorkflow' => 'ArcanistWorkflow',
|
'ArcanistBackoutWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistBaseCommitParserTestCase' => 'ArcanistTestCase',
|
'ArcanistBaseCommitParserTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistBaseXHPASTLinter' => 'ArcanistFutureLinter',
|
'ArcanistBaseXHPASTLinter' => 'ArcanistFutureLinter',
|
||||||
'ArcanistBookmarkWorkflow' => 'ArcanistFeatureWorkflow',
|
'ArcanistBookmarkWorkflow' => 'ArcanistFeatureWorkflow',
|
||||||
'ArcanistBranchWorkflow' => 'ArcanistFeatureWorkflow',
|
'ArcanistBranchWorkflow' => 'ArcanistFeatureWorkflow',
|
||||||
'ArcanistBritishTestCase' => 'ArcanistTestCase',
|
'ArcanistBritishTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistBrowseWorkflow' => 'ArcanistWorkflow',
|
'ArcanistBrowseWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistBundleTestCase' => 'ArcanistTestCase',
|
'ArcanistBundleTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistCSSLintLinter' => 'ArcanistExternalLinter',
|
'ArcanistCSSLintLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistCSSLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistCSSLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistCSharpLinter' => 'ArcanistLinter',
|
'ArcanistCSharpLinter' => 'ArcanistLinter',
|
||||||
|
@ -237,7 +236,7 @@ phutil_register_library_map(array(
|
||||||
'ArcanistClosureLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistClosureLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistCoffeeLintLinter' => 'ArcanistExternalLinter',
|
'ArcanistCoffeeLintLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistCoffeeLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistCoffeeLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistCommentRemoverTestCase' => 'ArcanistTestCase',
|
'ArcanistCommentRemoverTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistCommitWorkflow' => 'ArcanistWorkflow',
|
'ArcanistCommitWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistCompilerLintRenderer' => 'ArcanistLintRenderer',
|
'ArcanistCompilerLintRenderer' => 'ArcanistLintRenderer',
|
||||||
'ArcanistComprehensiveLintEngine' => 'ArcanistLintEngine',
|
'ArcanistComprehensiveLintEngine' => 'ArcanistLintEngine',
|
||||||
|
@ -248,8 +247,8 @@ phutil_register_library_map(array(
|
||||||
'ArcanistCppcheckLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistCppcheckLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistCpplintLinter' => 'ArcanistExternalLinter',
|
'ArcanistCpplintLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistCpplintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistCpplintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistDiffParserTestCase' => 'ArcanistTestCase',
|
'ArcanistDiffParserTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistDiffUtilsTestCase' => 'ArcanistTestCase',
|
'ArcanistDiffUtilsTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistDiffWorkflow' => 'ArcanistWorkflow',
|
'ArcanistDiffWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistDifferentialCommitMessageParserException' => 'Exception',
|
'ArcanistDifferentialCommitMessageParserException' => 'Exception',
|
||||||
'ArcanistDifferentialDependencyGraph' => 'AbstractDirectedGraph',
|
'ArcanistDifferentialDependencyGraph' => 'AbstractDirectedGraph',
|
||||||
|
@ -272,7 +271,7 @@ phutil_register_library_map(array(
|
||||||
'ArcanistGoLintLinter' => 'ArcanistExternalLinter',
|
'ArcanistGoLintLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistGoLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistGoLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistGoTestResultParser' => 'ArcanistTestResultParser',
|
'ArcanistGoTestResultParser' => 'ArcanistTestResultParser',
|
||||||
'ArcanistGoTestResultParserTestCase' => 'ArcanistTestCase',
|
'ArcanistGoTestResultParserTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistHLintLinter' => 'ArcanistExternalLinter',
|
'ArcanistHLintLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistHLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistHLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistHelpWorkflow' => 'ArcanistWorkflow',
|
'ArcanistHelpWorkflow' => 'ArcanistWorkflow',
|
||||||
|
@ -294,11 +293,11 @@ phutil_register_library_map(array(
|
||||||
'ArcanistLiberateWorkflow' => 'ArcanistWorkflow',
|
'ArcanistLiberateWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistLibraryTestCase' => 'PhutilLibraryTestCase',
|
'ArcanistLibraryTestCase' => 'PhutilLibraryTestCase',
|
||||||
'ArcanistLintWorkflow' => 'ArcanistWorkflow',
|
'ArcanistLintWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistLinterTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistLinterTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistLintersWorkflow' => 'ArcanistWorkflow',
|
'ArcanistLintersWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistListWorkflow' => 'ArcanistWorkflow',
|
'ArcanistListWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
|
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
|
||||||
'ArcanistMercurialParserTestCase' => 'ArcanistTestCase',
|
'ArcanistMercurialParserTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistMergeConflictLinter' => 'ArcanistLinter',
|
'ArcanistMergeConflictLinter' => 'ArcanistLinter',
|
||||||
'ArcanistMergeConflictLinterTestCase' => 'ArcanistLinterTestCase',
|
'ArcanistMergeConflictLinterTestCase' => 'ArcanistLinterTestCase',
|
||||||
'ArcanistMissingLinterException' => 'Exception',
|
'ArcanistMissingLinterException' => 'Exception',
|
||||||
|
@ -318,9 +317,6 @@ phutil_register_library_map(array(
|
||||||
'ArcanistPhpunitTestResultParser' => 'ArcanistTestResultParser',
|
'ArcanistPhpunitTestResultParser' => 'ArcanistTestResultParser',
|
||||||
'ArcanistPhrequentWorkflow' => 'ArcanistWorkflow',
|
'ArcanistPhrequentWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistPhutilLibraryLinter' => 'ArcanistLinter',
|
'ArcanistPhutilLibraryLinter' => 'ArcanistLinter',
|
||||||
'ArcanistPhutilTestCaseTestCase' => 'ArcanistPhutilTestCase',
|
|
||||||
'ArcanistPhutilTestSkippedException' => 'Exception',
|
|
||||||
'ArcanistPhutilTestTerminatedException' => 'Exception',
|
|
||||||
'ArcanistPhutilXHPASTLinter' => 'ArcanistBaseXHPASTLinter',
|
'ArcanistPhutilXHPASTLinter' => 'ArcanistBaseXHPASTLinter',
|
||||||
'ArcanistPhutilXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
|
'ArcanistPhutilXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
|
||||||
'ArcanistPuppetLintLinter' => 'ArcanistExternalLinter',
|
'ArcanistPuppetLintLinter' => 'ArcanistExternalLinter',
|
||||||
|
@ -329,8 +325,8 @@ phutil_register_library_map(array(
|
||||||
'ArcanistPyFlakesLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistPyFlakesLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistPyLintLinter' => 'ArcanistExternalLinter',
|
'ArcanistPyLintLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistPyLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistPyLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
'ArcanistRepositoryAPIMiscTestCase' => 'ArcanistTestCase',
|
'ArcanistRepositoryAPIMiscTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistRepositoryAPIStateTestCase' => 'ArcanistTestCase',
|
'ArcanistRepositoryAPIStateTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistRevertWorkflow' => 'ArcanistWorkflow',
|
'ArcanistRevertWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistRuboCopLinter' => 'ArcanistExternalLinter',
|
'ArcanistRuboCopLinter' => 'ArcanistExternalLinter',
|
||||||
'ArcanistRuboCopLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
'ArcanistRuboCopLinterTestCase' => 'ArcanistExternalLinterTestCase',
|
||||||
|
@ -347,7 +343,6 @@ phutil_register_library_map(array(
|
||||||
'ArcanistSubversionAPI' => 'ArcanistRepositoryAPI',
|
'ArcanistSubversionAPI' => 'ArcanistRepositoryAPI',
|
||||||
'ArcanistSummaryLintRenderer' => 'ArcanistLintRenderer',
|
'ArcanistSummaryLintRenderer' => 'ArcanistLintRenderer',
|
||||||
'ArcanistTasksWorkflow' => 'ArcanistWorkflow',
|
'ArcanistTasksWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistTestCase' => 'ArcanistPhutilTestCase',
|
|
||||||
'ArcanistTestXHPASTLintSwitchHook' => 'ArcanistXHPASTLintSwitchHook',
|
'ArcanistTestXHPASTLintSwitchHook' => 'ArcanistXHPASTLintSwitchHook',
|
||||||
'ArcanistTextLinter' => 'ArcanistLinter',
|
'ArcanistTextLinter' => 'ArcanistLinter',
|
||||||
'ArcanistTextLinterTestCase' => 'ArcanistLinterTestCase',
|
'ArcanistTextLinterTestCase' => 'ArcanistLinterTestCase',
|
||||||
|
@ -364,7 +359,7 @@ phutil_register_library_map(array(
|
||||||
'ArcanistVersionWorkflow' => 'ArcanistWorkflow',
|
'ArcanistVersionWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistWhichWorkflow' => 'ArcanistWorkflow',
|
'ArcanistWhichWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistWorkflow' => 'Phobject',
|
'ArcanistWorkflow' => 'Phobject',
|
||||||
'ArcanistXHPASTLintNamingHookTestCase' => 'ArcanistTestCase',
|
'ArcanistXHPASTLintNamingHookTestCase' => 'PhutilTestCase',
|
||||||
'ArcanistXHPASTLinter' => 'ArcanistBaseXHPASTLinter',
|
'ArcanistXHPASTLinter' => 'ArcanistBaseXHPASTLinter',
|
||||||
'ArcanistXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
|
'ArcanistXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
|
||||||
'ArcanistXMLLinter' => 'ArcanistLinter',
|
'ArcanistXMLLinter' => 'ArcanistLinter',
|
||||||
|
@ -372,11 +367,14 @@ phutil_register_library_map(array(
|
||||||
'CSharpToolsTestEngine' => 'XUnitTestEngine',
|
'CSharpToolsTestEngine' => 'XUnitTestEngine',
|
||||||
'NoseTestEngine' => 'ArcanistUnitTestEngine',
|
'NoseTestEngine' => 'ArcanistUnitTestEngine',
|
||||||
'PhpunitTestEngine' => 'ArcanistUnitTestEngine',
|
'PhpunitTestEngine' => 'ArcanistUnitTestEngine',
|
||||||
'PhpunitTestEngineTestCase' => 'ArcanistTestCase',
|
'PhpunitTestEngineTestCase' => 'PhutilTestCase',
|
||||||
|
'PhutilTestCaseTestCase' => 'PhutilTestCase',
|
||||||
|
'PhutilTestSkippedException' => 'Exception',
|
||||||
|
'PhutilTestTerminatedException' => 'Exception',
|
||||||
'PhutilUnitTestEngine' => 'ArcanistUnitTestEngine',
|
'PhutilUnitTestEngine' => 'ArcanistUnitTestEngine',
|
||||||
'PhutilUnitTestEngineTestCase' => 'ArcanistTestCase',
|
'PhutilUnitTestEngineTestCase' => 'PhutilTestCase',
|
||||||
'PytestTestEngine' => 'ArcanistUnitTestEngine',
|
'PytestTestEngine' => 'ArcanistUnitTestEngine',
|
||||||
'XUnitTestEngine' => 'ArcanistUnitTestEngine',
|
'XUnitTestEngine' => 'ArcanistUnitTestEngine',
|
||||||
'XUnitTestResultParserTestCase' => 'ArcanistTestCase',
|
'XUnitTestResultParserTestCase' => 'PhutilTestCase',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ArcanistBritishTestCase extends ArcanistTestCase {
|
final class ArcanistBritishTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testCommandCompletion() {
|
public function testCommandCompletion() {
|
||||||
$this->assertCommandCompletion(
|
$this->assertCommandCompletion(
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Test cases for @{class:ArcanistDiffUtils}.
|
* Test cases for @{class:ArcanistDiffUtils}.
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
final class ArcanistDiffUtilsTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testLevenshtein() {
|
public function testLevenshtein() {
|
||||||
$tests = array(
|
$tests = array(
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
abstract class ArcanistTestCase extends ArcanistPhutilTestCase {}
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Facilitates implementation of test cases for @{class:ArcanistLinter}s.
|
* Facilitates implementation of test cases for @{class:ArcanistLinter}s.
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
|
abstract class ArcanistLinterTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an instance of the linter being tested.
|
* Returns an instance of the linter being tested.
|
||||||
|
@ -148,7 +148,7 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
|
||||||
$result = reset($results);
|
$result = reset($results);
|
||||||
$patcher = ArcanistLintPatcher::newFromArcanistLintResult($result);
|
$patcher = ArcanistLintPatcher::newFromArcanistLintResult($result);
|
||||||
$after_lint = $patcher->getModifiedFileContent();
|
$after_lint = $patcher->getModifiedFileContent();
|
||||||
} catch (ArcanistPhutilTestTerminatedException $ex) {
|
} catch (PhutilTestTerminatedException $ex) {
|
||||||
throw $ex;
|
throw $ex;
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
$caught_exception = true;
|
$caught_exception = true;
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
/**
|
/**
|
||||||
* Test cases for @{class:ArcanistXHPASTLintNamingHook}.
|
* Test cases for @{class:ArcanistXHPASTLintNamingHook}.
|
||||||
*/
|
*/
|
||||||
final class ArcanistXHPASTLintNamingHookTestCase extends ArcanistTestCase {
|
final class ArcanistXHPASTLintNamingHookTestCase
|
||||||
|
extends PhutilTestCase {
|
||||||
|
|
||||||
public function testCaseUtilities() {
|
public function testCaseUtilities() {
|
||||||
$tests = array(
|
$tests = array(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
|
final class ArcanistBaseCommitParserTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testBasics() {
|
public function testBasics() {
|
||||||
// Verify that the very basics of base commit resolution work.
|
// Verify that the very basics of base commit resolution work.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ArcanistBundleTestCase extends ArcanistTestCase {
|
final class ArcanistBundleTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
private function loadResource($name) {
|
private function loadResource($name) {
|
||||||
return Filesystem::readFile($this->getResourcePath($name));
|
return Filesystem::readFile($this->getResourcePath($name));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ArcanistCommentRemoverTestCase extends ArcanistTestCase {
|
final class ArcanistCommentRemoverTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testRemover() {
|
public function testRemover() {
|
||||||
$test = <<<EOTEXT
|
$test = <<<EOTEXT
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Test cases for @{class:ArcanistDiffParser}.
|
* Test cases for @{class:ArcanistDiffParser}.
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffParserTestCase extends ArcanistTestCase {
|
final class ArcanistDiffParserTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testParser() {
|
public function testParser() {
|
||||||
$root = dirname(__FILE__).'/diff/';
|
$root = dirname(__FILE__).'/diff/';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ArcanistRepositoryAPIMiscTestCase extends ArcanistTestCase {
|
final class ArcanistRepositoryAPIMiscTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testSVNFileEscapes() {
|
public function testSVNFileEscapes() {
|
||||||
$input = array(
|
$input = array(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ArcanistRepositoryAPIStateTestCase extends ArcanistTestCase {
|
final class ArcanistRepositoryAPIStateTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testGitStateParsing() {
|
public function testGitStateParsing() {
|
||||||
if (Filesystem::binaryExists('git')) {
|
if (Filesystem::binaryExists('git')) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class ArcanistMercurialParserTestCase extends ArcanistTestCase {
|
final class ArcanistMercurialParserTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testParseAll() {
|
public function testParseAll() {
|
||||||
$root = dirname(__FILE__).'/mercurial/';
|
$root = dirname(__FILE__).'/mercurial/';
|
||||||
|
|
|
@ -75,7 +75,7 @@ final class PhutilUnitTestEngine extends ArcanistUnitTestEngine {
|
||||||
|
|
||||||
$symbols = id(new PhutilSymbolLoader())
|
$symbols = id(new PhutilSymbolLoader())
|
||||||
->setType('class')
|
->setType('class')
|
||||||
->setAncestorClass('ArcanistPhutilTestCase')
|
->setAncestorClass('PhutilTestCase')
|
||||||
->setConcreteOnly(true)
|
->setConcreteOnly(true)
|
||||||
->selectSymbolsWithoutLoading();
|
->selectSymbolsWithoutLoading();
|
||||||
|
|
||||||
|
@ -163,8 +163,8 @@ final class PhutilUnitTestEngine extends ArcanistUnitTestEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for any class that extends ArcanistPhutilTestCase inside a
|
// Look for any class that extends PhutilTestCase inside a `__tests__`
|
||||||
// __tests__ directory in any parent directory of every affected file.
|
// directory in any parent directory of every affected file.
|
||||||
//
|
//
|
||||||
// The idea is that "infrastructure/__tests__/" tests defines general tests
|
// The idea is that "infrastructure/__tests__/" tests defines general tests
|
||||||
// for all of "infrastructure/", and those tests run for any change in
|
// for all of "infrastructure/", and those tests run for any change in
|
||||||
|
@ -181,7 +181,7 @@ final class PhutilUnitTestEngine extends ArcanistUnitTestEngine {
|
||||||
->setType('class')
|
->setType('class')
|
||||||
->setLibrary($library)
|
->setLibrary($library)
|
||||||
->setPathPrefix(($path ? $path.'/' : '').'__tests__/')
|
->setPathPrefix(($path ? $path.'/' : '').'__tests__/')
|
||||||
->setAncestorClass('ArcanistPhutilTestCase')
|
->setAncestorClass('PhutilTestCase')
|
||||||
->setConcreteOnly(true)
|
->setConcreteOnly(true)
|
||||||
->selectAndLoadSymbols();
|
->selectAndLoadSymbols();
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Tests for @{class:PhpunitTestEngine}.
|
* Tests for @{class:PhpunitTestEngine}.
|
||||||
*/
|
*/
|
||||||
final class PhpunitTestEngineTestCase extends ArcanistTestCase {
|
final class PhpunitTestEngineTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testSearchLocations() {
|
public function testSearchLocations() {
|
||||||
$path = '/path/to/some/file/X.php';
|
$path = '/path/to/some/file/X.php';
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Very meta test for @{class:PhutilUnitTestEngine}.
|
* Very meta test for @{class:PhutilUnitTestEngine}.
|
||||||
*/
|
*/
|
||||||
final class PhutilUnitTestEngineTestCase extends ArcanistTestCase {
|
final class PhutilUnitTestEngineTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
private static $allTestsCounter = 0;
|
private static $allTestsCounter = 0;
|
||||||
private static $oneTestCounter = 0;
|
private static $oneTestCounter = 0;
|
||||||
|
@ -76,7 +76,7 @@ final class PhutilUnitTestEngineTestCase extends ArcanistTestCase {
|
||||||
$failed = 0;
|
$failed = 0;
|
||||||
$skipped = 0;
|
$skipped = 0;
|
||||||
|
|
||||||
$test_case = id(new ArcanistPhutilTestCaseTestCase())
|
$test_case = id(new PhutilTestCaseTestCase())
|
||||||
->setWorkingCopy($this->getWorkingCopy());
|
->setWorkingCopy($this->getWorkingCopy());
|
||||||
|
|
||||||
foreach ($test_case->run() as $result) {
|
foreach ($test_case->run() as $result) {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* @task hook Hooks for Setup and Teardown
|
* @task hook Hooks for Setup and Teardown
|
||||||
* @task internal Internals
|
* @task internal Internals
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistPhutilTestCase {
|
abstract class PhutilTestCase {
|
||||||
|
|
||||||
private $assertions = 0;
|
private $assertions = 0;
|
||||||
private $runningTest;
|
private $runningTest;
|
||||||
|
@ -122,7 +122,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->failTest($output);
|
$this->failTest($output);
|
||||||
throw new ArcanistPhutilTestTerminatedException($output);
|
throw new PhutilTestTerminatedException($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
*/
|
*/
|
||||||
final protected function assertFailure($message) {
|
final protected function assertFailure($message) {
|
||||||
$this->failTest($message);
|
$this->failTest($message);
|
||||||
throw new ArcanistPhutilTestTerminatedException($message);
|
throw new PhutilTestTerminatedException($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -150,7 +150,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
*/
|
*/
|
||||||
final protected function assertSkipped($message) {
|
final protected function assertSkipped($message) {
|
||||||
$this->skipTest($message);
|
$this->skipTest($message);
|
||||||
throw new ArcanistPhutilTestSkippedException($message);
|
throw new PhutilTestSkippedException($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
try {
|
try {
|
||||||
call_user_func($callable, $input);
|
call_user_func($callable, $input);
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
if ($ex instanceof ArcanistPhutilTestTerminatedException) {
|
if ($ex instanceof PhutilTestTerminatedException) {
|
||||||
throw $ex;
|
throw $ex;
|
||||||
}
|
}
|
||||||
if (!($ex instanceof $exception_class)) {
|
if (!($ex instanceof $exception_class)) {
|
||||||
|
@ -363,7 +363,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
* This hook is invoked once, before any test cases execute. It gives you
|
* This hook is invoked once, before any test cases execute. It gives you
|
||||||
* an opportunity to perform setup steps for the entire suite of test cases.
|
* an opportunity to perform setup steps for the entire suite of test cases.
|
||||||
*
|
*
|
||||||
* @param list<ArcanistPhutilTestCase> List of test cases to be run.
|
* @param list<PhutilTestCase> List of test cases to be run.
|
||||||
* @return void
|
* @return void
|
||||||
* @task hook
|
* @task hook
|
||||||
*/
|
*/
|
||||||
|
@ -375,7 +375,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
/**
|
/**
|
||||||
* This hook is invoked once, after all test cases execute.
|
* This hook is invoked once, after all test cases execute.
|
||||||
*
|
*
|
||||||
* @param list<ArcanistPhutilTestCase> List of test cases that ran.
|
* @param list<PhutilTestCase> List of test cases that ran.
|
||||||
* @return void
|
* @return void
|
||||||
* @task hook
|
* @task hook
|
||||||
*/
|
*/
|
||||||
|
@ -515,9 +515,9 @@ abstract class ArcanistPhutilTestCase {
|
||||||
'least one assertion.'));
|
'least one assertion.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (ArcanistPhutilTestTerminatedException $ex) {
|
} catch (PhutilTestTerminatedException $ex) {
|
||||||
// Continue with the next test.
|
// Continue with the next test.
|
||||||
} catch (ArcanistPhutilTestSkippedException $ex) {
|
} catch (PhutilTestSkippedException $ex) {
|
||||||
// Continue with the next test.
|
// Continue with the next test.
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$ex_class = get_class($ex);
|
$ex_class = get_class($ex);
|
||||||
|
@ -736,7 +736,7 @@ abstract class ArcanistPhutilTestCase {
|
||||||
$output = $description."\n\n".$header."\n".$actual_result;
|
$output = $description."\n\n".$header."\n".$actual_result;
|
||||||
|
|
||||||
$this->failTest($output);
|
$this->failTest($output);
|
||||||
throw new ArcanistPhutilTestTerminatedException($output);
|
throw new PhutilTestTerminatedException($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,6 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Thrown to skip test execution.
|
|
||||||
*/
|
|
||||||
final class ArcanistPhutilTestSkippedException extends Exception {}
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Thrown to prematurely end test execution.
|
|
||||||
*/
|
|
||||||
final class ArcanistPhutilTestTerminatedException extends Exception {}
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Test for @{class:PhutilUnitTestEngineTestCase}.
|
* Test for @{class:PhutilUnitTestEngineTestCase}.
|
||||||
*/
|
*/
|
||||||
final class ArcanistPhutilTestCaseTestCase extends ArcanistPhutilTestCase {
|
final class PhutilTestCaseTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testFail() {
|
public function testFail() {
|
||||||
$this->assertFailure(pht('This test is expected to fail.'));
|
$this->assertFailure(pht('This test is expected to fail.'));
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thrown to skip test execution.
|
||||||
|
*/
|
||||||
|
final class PhutilTestSkippedException extends Exception {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thrown to prematurely end test execution.
|
||||||
|
*/
|
||||||
|
final class PhutilTestTerminatedException extends Exception {}
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Test for @{class:ArcanistGoTestResultParser}.
|
* Test for @{class:ArcanistGoTestResultParser}.
|
||||||
*/
|
*/
|
||||||
final class ArcanistGoTestResultParserTestCase extends ArcanistTestCase {
|
final class ArcanistGoTestResultParserTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testSingleTestCaseSuccessful() {
|
public function testSingleTestCaseSuccessful() {
|
||||||
$stubbed_results = Filesystem::readFile(
|
$stubbed_results = Filesystem::readFile(
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Test for @{class:ArcanistXUnitTestResultParser}.
|
* Test for @{class:ArcanistXUnitTestResultParser}.
|
||||||
*/
|
*/
|
||||||
final class XUnitTestResultParserTestCase extends ArcanistTestCase {
|
final class XUnitTestResultParserTestCase extends PhutilTestCase {
|
||||||
|
|
||||||
public function testAcceptsNoTestsInput() {
|
public function testAcceptsNoTestsInput() {
|
||||||
$stubbed_results = Filesystem::readFile(
|
$stubbed_results = Filesystem::readFile(
|
||||||
|
|
Loading…
Reference in a new issue