Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108621332
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
Thu, Apr 17, 17:27
Size
900 B
Mime Type
text/x-php
Expires
Sat, Apr 19, 17:27 (2 d)
Engine
blob
Format
Raw Data
Handle
25631393
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