Fix gitlab tests
parent
a144b5e7ed
commit
e33d00f98e
|
@ -236,24 +236,34 @@ JSON;
|
||||||
$apiUrl = 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject/repository/branches?per_page=100';
|
$apiUrl = 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject/repository/branches?per_page=100';
|
||||||
|
|
||||||
// @link http://doc.gitlab.com/ce/api/repositories.html#list-project-repository-branches
|
// @link http://doc.gitlab.com/ce/api/repositories.html#list-project-repository-branches
|
||||||
$branchData = <<<JSON
|
$branchData = array(
|
||||||
[
|
array(
|
||||||
{
|
"name" => "mymaster",
|
||||||
"name": "mymaster",
|
"commit" => array(
|
||||||
"commit": {
|
"id" => "97eda36b5c1dd953a3792865c222d4e85e5f302e",
|
||||||
"id": "97eda36b5c1dd953a3792865c222d4e85e5f302e",
|
"committed_date" => "2013-01-03T21:04:07.000+01:00"
|
||||||
"committed_date": "2013-01-03T21:04:07.000+01:00"
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"name" => "staging",
|
||||||
|
"commit" => array(
|
||||||
|
"id" => "502cffe49f136443f2059803f2e7192d1ac066cd",
|
||||||
|
"committed_date" => "2013-03-09T16:35:23.000+01:00"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
for ($i = 0; $i < 98; $i++) {
|
||||||
|
$branchData[] = array(
|
||||||
|
"name" => "stagingdupe",
|
||||||
|
"commit" => array(
|
||||||
|
"id" => "502cffe49f136443f2059803f2e7192d1ac066cd",
|
||||||
|
"committed_date" => "2013-03-09T16:35:23.000+01:00"
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
$branchData = json_encode($branchData);
|
||||||
"name": "staging",
|
|
||||||
"commit": {
|
|
||||||
"id": "502cffe49f136443f2059803f2e7192d1ac066cd",
|
|
||||||
"committed_date": "2013-03-09T16:35:23.000+01:00"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
JSON;
|
|
||||||
|
|
||||||
$this->remoteFilesystem
|
$this->remoteFilesystem
|
||||||
->getContents('gitlab.com', $apiUrl, false, array())
|
->getContents('gitlab.com', $apiUrl, false, array())
|
||||||
|
@ -279,6 +289,7 @@ JSON;
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'mymaster' => '97eda36b5c1dd953a3792865c222d4e85e5f302e',
|
'mymaster' => '97eda36b5c1dd953a3792865c222d4e85e5f302e',
|
||||||
'staging' => '502cffe49f136443f2059803f2e7192d1ac066cd',
|
'staging' => '502cffe49f136443f2059803f2e7192d1ac066cd',
|
||||||
|
'stagingdupe' => '502cffe49f136443f2059803f2e7192d1ac066cd',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals($expected, $driver->getBranches());
|
$this->assertEquals($expected, $driver->getBranches());
|
||||||
|
|
Loading…
Reference in New Issue