Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79845050
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, Aug 28, 13:44
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Aug 30, 13:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20240803
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