Differential D8096 Diff 18345 src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php
Show All 32 Lines | $repo = PhabricatorRepository::initializeNewRepository($user) | ||||
->save(); | ->save(); | ||||
// Test HTTP URIs. | // Test HTTP URIs. | ||||
$repo->setDetail('remote-uri', 'http://example.com/'); | $repo->setDetail('remote-uri', 'http://example.com/'); | ||||
$repo->setVersionControlSystem($svn); | $repo->setVersionControlSystem($svn); | ||||
$this->assertEqual('http://example.com/', $repo->getRemoteURI()); | $this->assertEqual('http://example.com/', $repo->getRemoteURI()); | ||||
$this->assertEqual('http://example.com/', $repo->getPublicRemoteURI()); | $this->assertEqual('http://example.com/', $repo->getPublicCloneURI()); | ||||
$this->assertEqual('http://example.com/', | $this->assertEqual('http://example.com/', | ||||
$repo->getRemoteURIEnvelope()->openEnvelope()); | $repo->getRemoteURIEnvelope()->openEnvelope()); | ||||
$repo->setVersionControlSystem($git); | $repo->setVersionControlSystem($git); | ||||
$this->assertEqual('http://example.com/', $repo->getRemoteURI()); | $this->assertEqual('http://example.com/', $repo->getRemoteURI()); | ||||
$this->assertEqual('http://example.com/', $repo->getPublicRemoteURI()); | $this->assertEqual('http://example.com/', $repo->getPublicCloneURI()); | ||||
$this->assertEqual('http://duck:quack@example.com/', | $this->assertEqual('http://duck:quack@example.com/', | ||||
$repo->getRemoteURIEnvelope()->openEnvelope()); | $repo->getRemoteURIEnvelope()->openEnvelope()); | ||||
$repo->setVersionControlSystem($hg); | $repo->setVersionControlSystem($hg); | ||||
$this->assertEqual('http://example.com/', $repo->getRemoteURI()); | $this->assertEqual('http://example.com/', $repo->getRemoteURI()); | ||||
$this->assertEqual('http://example.com/', $repo->getPublicRemoteURI()); | $this->assertEqual('http://example.com/', $repo->getPublicCloneURI()); | ||||
$this->assertEqual('http://duck:quack@example.com/', | $this->assertEqual('http://duck:quack@example.com/', | ||||
$repo->getRemoteURIEnvelope()->openEnvelope()); | $repo->getRemoteURIEnvelope()->openEnvelope()); | ||||
// Test SSH URIs. | // Test SSH URIs. | ||||
$repo->setDetail('remote-uri', 'ssh://example.com/'); | $repo->setDetail('remote-uri', 'ssh://example.com/'); | ||||
$repo->setVersionControlSystem($svn); | $repo->setVersionControlSystem($svn); | ||||
$this->assertEqual('ssh://example.com/', $repo->getRemoteURI()); | $this->assertEqual('ssh://example.com/', $repo->getRemoteURI()); | ||||
$this->assertEqual('ssh://example.com/', $repo->getPublicRemoteURI()); | $this->assertEqual('ssh://example.com/', $repo->getPublicCloneURI()); | ||||
$this->assertEqual('ssh://example.com/', | $this->assertEqual('ssh://example.com/', | ||||
$repo->getRemoteURIEnvelope()->openEnvelope()); | $repo->getRemoteURIEnvelope()->openEnvelope()); | ||||
$repo->setVersionControlSystem($git); | $repo->setVersionControlSystem($git); | ||||
$this->assertEqual('ssh://example.com/', $repo->getRemoteURI()); | $this->assertEqual('ssh://example.com/', $repo->getRemoteURI()); | ||||
$this->assertEqual('ssh://example.com/', $repo->getPublicRemoteURI()); | $this->assertEqual('ssh://example.com/', $repo->getPublicCloneURI()); | ||||
$this->assertEqual('ssh://example.com/', | $this->assertEqual('ssh://example.com/', | ||||
$repo->getRemoteURIEnvelope()->openEnvelope()); | $repo->getRemoteURIEnvelope()->openEnvelope()); | ||||
$repo->setVersionControlSystem($hg); | $repo->setVersionControlSystem($hg); | ||||
$this->assertEqual('ssh://example.com/', $repo->getRemoteURI()); | $this->assertEqual('ssh://example.com/', $repo->getRemoteURI()); | ||||
$this->assertEqual('ssh://example.com/', $repo->getPublicRemoteURI()); | $this->assertEqual('ssh://example.com/', $repo->getPublicCloneURI()); | ||||
$this->assertEqual('ssh://example.com/', | $this->assertEqual('ssh://example.com/', | ||||
$repo->getRemoteURIEnvelope()->openEnvelope()); | $repo->getRemoteURIEnvelope()->openEnvelope()); | ||||
// Test Git URIs. | // Test Git URIs. | ||||
$repo->setDetail('remote-uri', 'git@example.com:path.git'); | $repo->setDetail('remote-uri', 'git@example.com:path.git'); | ||||
$repo->setVersionControlSystem($git); | $repo->setVersionControlSystem($git); | ||||
$this->assertEqual('git@example.com:path.git', $repo->getRemoteURI()); | $this->assertEqual('git@example.com:path.git', $repo->getRemoteURI()); | ||||
$this->assertEqual('git@example.com:path.git', $repo->getPublicRemoteURI()); | $this->assertEqual('git@example.com:path.git', $repo->getPublicCloneURI()); | ||||
$this->assertEqual('git@example.com:path.git', | $this->assertEqual('git@example.com:path.git', | ||||
$repo->getRemoteURIEnvelope()->openEnvelope()); | $repo->getRemoteURIEnvelope()->openEnvelope()); | ||||
} | } | ||||
} | } |