1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-24 13:38:18 +01:00
phorge-arcanist/src/lint/engine/ArcanistUnitTestableLintEngine.php
Joshua Spence f58642a8ab Add unit tests for ArcanistFilenameLinter
Summary: Self-explanatory.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11341
2015-01-13 06:47:19 +11:00

32 lines
634 B
PHP

<?php
/**
* Lint engine for use in constructing test cases. See
* @{class:ArcanistLinterTestCase}.
*/
final class ArcanistUnitTestableLintEngine extends ArcanistLintEngine {
protected $linters = array();
public function addLinter($linter) {
$this->linters[] = $linter;
return $this;
}
public function addFileData($path, $data) {
$this->fileData[$path] = $data;
return $this;
}
public function pathExists($path) {
if (idx($this->fileData, $path) !== null) {
return true;
}
return parent::pathExists($path);
}
public function buildLinters() {
return $this->linters;
}
}