Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110848342
PhutilGitURITestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Apr 28, 10:25
Size
900 B
Mime Type
text/x-php
Expires
Wed, Apr 30, 10:25 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
25856173
Attached To
rPHU libphutil
PhutilGitURITestCase.php
View Options
<?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
());
}
}
Event Timeline
Log In to Comment