Page MenuHomePhorge

PhutilGitURITestCase.php
No OneTemporary

PhutilGitURITestCase.php

<?php
/**
* @covers PhutilGitURI
*/
final class PhutilGitURITestCase extends PhutilTestCase {
public function testGitURIParsing() {
$uri = new PhutilGitURI('git@host.com:path/to/something');
$this->assertEqual('git', $uri->getUser());
$this->assertEqual('host.com', $uri->getDomain());
$this->assertEqual('path/to/something', $uri->getPath());
$this->assertEqual('git@host.com:path/to/something', (string)$uri);
$uri = new PhutilGitURI('host.com:path/to/something');
$this->assertEqual('', $uri->getUser());
$this->assertEqual('host.com', $uri->getDomain());
$this->assertEqual('path/to/something', $uri->getPath());
$this->assertEqual('host.com:path/to/something', (string)$uri);
}
public function testStrictGitURIParsingOfLeadingWhitespace() {
$uri = new PhutilURI(' user@example.com');
$this->assertEqual('', $uri->getDomain());
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 20:04 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1116133
Default Alt Text
PhutilGitURITestCase.php (900 B)

Event Timeline