1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 14:00:55 +01:00

Remove getLink() from ArcanistLinterTestCase

Summary:
Installations extend this.

Another solution would be to extend `ArcanistLinterTestCase` from `ArcanistArcanistLinterTestCase` and return null in `getLink()` to avoid code duplication but I prefer clean class hierarchy.

Test Plan:
  $ arc unit

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3878
This commit is contained in:
vrana 2012-11-02 18:09:38 -07:00
parent 53c9167953
commit ac92f9bdfc
8 changed files with 34 additions and 13 deletions

View file

@ -15,6 +15,7 @@ phutil_register_library_map(array(
'ArcanistAnoidWorkflow' => 'workflow/ArcanistAnoidWorkflow.php',
'ArcanistApacheLicenseLinter' => 'lint/linter/ArcanistApacheLicenseLinter.php',
'ArcanistApacheLicenseLinterTestCase' => 'lint/linter/__tests__/ArcanistApacheLicenseLinterTestCase.php',
'ArcanistArcanistLinterTestCase' => 'lint/linter/__tests__/ArcanistArcanistLinterTestCase.php',
'ArcanistBaseCommitParser' => 'parser/ArcanistBaseCommitParser.php',
'ArcanistBaseCommitParserTestCase' => 'parser/__tests__/ArcanistBaseCommitParserTestCase.php',
'ArcanistBaseUnitTestEngine' => 'unit/engine/ArcanistBaseUnitTestEngine.php',
@ -151,7 +152,8 @@ phutil_register_library_map(array(
'ArcanistAmendWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistAnoidWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistApacheLicenseLinter' => 'ArcanistLicenseLinter',
'ArcanistApacheLicenseLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistApacheLicenseLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistArcanistLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistBaseCommitParserTestCase' => 'ArcanistTestCase',
'ArcanistBranchWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistBundleTestCase' => 'ArcanistTestCase',
@ -192,7 +194,7 @@ phutil_register_library_map(array(
'ArcanistLintLikeCompilerRenderer' => 'ArcanistLintRenderer',
'ArcanistLintSummaryRenderer' => 'ArcanistLintRenderer',
'ArcanistLintWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistLinterTestCase' => 'ArcanistTestCase',
'ArcanistLinterTestCase' => 'ArcanistPhutilTestCase',
'ArcanistListWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistMarkCommittedWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
@ -212,20 +214,20 @@ phutil_register_library_map(array(
'ArcanistPyFlakesLinter' => 'ArcanistLinter',
'ArcanistPyLintLinter' => 'ArcanistLinter',
'ArcanistRubyLinter' => 'ArcanistLinter',
'ArcanistRubyLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistRubyLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistScriptAndRegexLinter' => 'ArcanistLinter',
'ArcanistSetConfigWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistShellCompleteWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistSingleLintEngine' => 'ArcanistLintEngine',
'ArcanistSpellingLinter' => 'ArcanistLinter',
'ArcanistSpellingLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistSpellingLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistSubversionAPI' => 'ArcanistRepositoryAPI',
'ArcanistSubversionHookAPI' => 'ArcanistHookAPI',
'ArcanistSvnHookPreCommitWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistTasksWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistTestCase' => 'ArcanistPhutilTestCase',
'ArcanistTextLinter' => 'ArcanistLinter',
'ArcanistTextLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistTextLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ArcanistTodoWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistUncommittedChangesException' => 'ArcanistUsageException',
'ArcanistUnitWorkflow' => 'ArcanistBaseWorkflow',
@ -236,7 +238,7 @@ phutil_register_library_map(array(
'ArcanistWhichWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistXHPASTLintNamingHookTestCase' => 'ArcanistTestCase',
'ArcanistXHPASTLinter' => 'ArcanistLinter',
'ArcanistXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
'ArcanistXHPASTLinterTestCase' => 'ArcanistArcanistLinterTestCase',
'ComprehensiveLintEngine' => 'ArcanistLintEngine',
'ExampleLintEngine' => 'ArcanistLintEngine',
'NoseTestEngine' => 'ArcanistBaseUnitTestEngine',

View file

@ -5,7 +5,8 @@
*
* @group testcase
*/
final class ArcanistApacheLicenseLinterTestCase extends ArcanistLinterTestCase {
final class ArcanistApacheLicenseLinterTestCase
extends ArcanistArcanistLinterTestCase {
public function testApacheLicenseLint() {
$linter = new ArcanistApacheLicenseLinter();

View file

@ -0,0 +1,17 @@
<?php
/**
* @group testcase
*/
abstract class ArcanistArcanistLinterTestCase extends ArcanistLinterTestCase {
protected function getLink($method) {
// This could be converted to trait from ArcanistTestCase.
$arcanist_project = 'PHID-APRJ-703e0b140530f17ede30';
return
'https://secure.phabricator.com/diffusion/symbol/'.$method.
'/?lang=php&projects='.$arcanist_project.
'&jump=true&context='.get_class($this);
}
}

View file

@ -5,7 +5,7 @@
*
* @group testcase
*/
abstract class ArcanistLinterTestCase extends ArcanistTestCase {
abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
public function executeTestsInDirectory($root, $linter, $working_copy) {
foreach (Filesystem::listDirectory($root, $hidden = false) as $file) {

View file

@ -5,7 +5,7 @@
*
* @group testcase
*/
final class ArcanistRubyLinterTestCase extends ArcanistLinterTestCase {
final class ArcanistRubyLinterTestCase extends ArcanistArcanistLinterTestCase {
public function testRubyLint() {
$linter = new ArcanistRubyLinter();
@ -17,4 +17,3 @@ final class ArcanistRubyLinterTestCase extends ArcanistLinterTestCase {
}
}

View file

@ -5,7 +5,8 @@
*
* @group testcase
*/
final class ArcanistSpellingLinterTestCase extends ArcanistLinterTestCase {
final class ArcanistSpellingLinterTestCase
extends ArcanistArcanistLinterTestCase {
public function testSpellingLint() {
$linter = new ArcanistSpellingLinter();

View file

@ -5,7 +5,7 @@
*
* @group testcase
*/
final class ArcanistTextLinterTestCase extends ArcanistLinterTestCase {
final class ArcanistTextLinterTestCase extends ArcanistArcanistLinterTestCase {
public function testTextLint() {
$linter = new ArcanistTextLinter();

View file

@ -5,7 +5,8 @@
*
* @group testcase
*/
final class ArcanistXHPASTLinterTestCase extends ArcanistLinterTestCase {
final class ArcanistXHPASTLinterTestCase
extends ArcanistArcanistLinterTestCase {
public function testXHPASTLint() {
$linter = new ArcanistXHPASTLinter();