Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96140682
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, Dec 23, 01:57
Size
778 B
Mime Type
text/x-php
Expires
Wed, Dec 25, 01:57 (2 d)
Engine
blob
Format
Raw Data
Handle
23106042
Attached To
rPHU libphutil
PhutilGitURITestCase.php
View Options
<?php
/**
* Test cases for @{class:PhutilGitURI} parser.
*
* @group util
*/
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
);
}
}
Event Timeline
Log In to Comment