Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73839354
PhabricatorWorkingCopyDiscoveryTestCase.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
Wed, Jul 24, 19:05
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jul 26, 19:05 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19281145
Attached To
rPH Phabricator
PhabricatorWorkingCopyDiscoveryTestCase.php
View Options
<?php
final
class
PhabricatorWorkingCopyDiscoveryTestCase
extends
PhabricatorWorkingCopyTestCase
{
public
function
testSubversionCommitDiscovery
()
{
$refs
=
$this
->
discoverRefs
(
'ST'
);
$this
->
assertEqual
(
array
(
1368319433
,
1368319448
,
),
mpull
(
$refs
,
'getEpoch'
),
'Commit Epochs'
);
}
public
function
testMercurialCommitDiscovery
()
{
$refs
=
$this
->
discoverRefs
(
'HT'
);
$this
->
assertEqual
(
array
(
'4a110ae879f473f2e82ffd032475caedd6cdba91'
,
),
mpull
(
$refs
,
'getIdentifier'
));
}
public
function
testGitCommitDiscovery
()
{
$refs
=
$this
->
discoverRefs
(
'GT'
);
$this
->
assertEqual
(
array
(
'763d4ab372445551c95fb5cccd1a7a223f5b2ac8'
,
),
mpull
(
$refs
,
'getIdentifier'
));
}
private
function
discoverRefs
(
$callsign
)
{
$repo
=
$this
->
buildPulledRepository
(
$callsign
);
$engine
=
id
(
new
PhabricatorRepositoryDiscoveryEngine
())
->
setRepository
(
$repo
);
$refs
=
$engine
->
discoverCommits
(
$repo
);
// The next time through, these should be cached as already discovered.
$new_refs
=
$engine
->
discoverCommits
(
$repo
);
$this
->
assertEqual
(
array
(),
$new_refs
);
return
$refs
;
}
}
Event Timeline
Log In to Comment