Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/__tests__/ArcanistRepositoryAPIStateTestCase.php
| <?php | <?php | ||||
| final class ArcanistRepositoryAPIStateTestCase extends ArcanistTestCase { | final class ArcanistRepositoryAPIStateTestCase extends ArcanistTestCase { | ||||
| public function testGitStateParsing() { | public function testGitStateParsing() { | ||||
| if (Filesystem::binaryExists('git')) { | if (Filesystem::binaryExists('git')) { | ||||
| $this->parseState('git_basic.git.tgz'); | $this->parseState('git_basic.git.tgz'); | ||||
| } else { | } else { | ||||
| $this->assertSkipped('Git is not installed'); | $this->assertSkipped(pht('Git is not installed')); | ||||
| } | } | ||||
| } | } | ||||
| public function testHgStateParsing() { | public function testHgStateParsing() { | ||||
| if (Filesystem::binaryExists('hg')) { | if (Filesystem::binaryExists('hg')) { | ||||
| $this->parseState('hg_basic.hg.tgz'); | $this->parseState('hg_basic.hg.tgz'); | ||||
| } else { | } else { | ||||
| $this->assertSkipped('Mercurial is not installed'); | $this->assertSkipped(pht('Mercurial is not installed')); | ||||
| } | } | ||||
| } | } | ||||
| public function testSvnStateParsing() { | public function testSvnStateParsing() { | ||||
| if (Filesystem::binaryExists('svn')) { | if (Filesystem::binaryExists('svn')) { | ||||
| $this->parseState('svn_basic.svn.tgz'); | $this->parseState('svn_basic.svn.tgz'); | ||||
| } else { | } else { | ||||
| $this->assertSkipped('Subversion is not installed'); | $this->assertSkipped(pht('Subversion is not installed')); | ||||
| } | } | ||||
| } | } | ||||
| private function parseState($test) { | private function parseState($test) { | ||||
| $dir = dirname(__FILE__).'/state/'; | $dir = dirname(__FILE__).'/state/'; | ||||
| $fixture = PhutilDirectoryFixture::newFromArchive($dir.'/'.$test); | $fixture = PhutilDirectoryFixture::newFromArchive($dir.'/'.$test); | ||||
| $fixture_path = $fixture->getPath(); | $fixture_path = $fixture->getPath(); | ||||
| ▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | switch ($test) { | ||||
| 'DELETED' => $f_del, | 'DELETED' => $f_del, | ||||
| 'MODIFIED' => $f_mod, | 'MODIFIED' => $f_mod, | ||||
| 'UNCOMMITTED' => $f_add, | 'UNCOMMITTED' => $f_add, | ||||
| ); | ); | ||||
| $this->assertEqual($expect_range, $api->getCommitRangeStatus()); | $this->assertEqual($expect_range, $api->getCommitRangeStatus()); | ||||
| break; | break; | ||||
| default: | default: | ||||
| throw new Exception( | throw new Exception( | ||||
| "No test cases for working copy '{$test}'!"); | pht("No test cases for working copy '%s'!", $test)); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||