Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894574
PhutilGitURITestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
900 B
Referenced Files
None
Subscribers
None
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
(
)
)
;
}
}
File Metadata
Details
Attached
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)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment