Skip to content

Commit 5b465f8

Browse files
yann-eugonem1guelpf
authored andcommitted
Added some tests for the 'min_access_level' projects filter
1 parent 713c178 commit 5b465f8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/Gitlab/Tests/Api/ProjectsTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ public function shouldGetNotArchivedProjects()
8282
$this->assertEquals($expectedArray, $api->all(['archived' => false]));
8383
}
8484

85+
/**
86+
* @test
87+
* @dataProvider possibleAccessLevels
88+
*/
89+
public function shouldGetProjectsWithMinimumAccessLevel($level)
90+
{
91+
$expectedArray = $this->getMultipleProjectsData();
92+
93+
$api = $this->getMultipleProjectsRequestMock('projects', $expectedArray, ['min_access_level' => $level]);
94+
95+
$this->assertEquals($expectedArray, $api->all(['min_access_level' => $level]));
96+
}
97+
8598
/**
8699
* @test
87100
*/
@@ -1461,6 +1474,17 @@ protected function getMultipleProjectsData()
14611474
);
14621475
}
14631476

1477+
public function possibleAccessLevels()
1478+
{
1479+
return [
1480+
[10],
1481+
[20],
1482+
[30],
1483+
[40],
1484+
[50],
1485+
];
1486+
}
1487+
14641488
protected function getApiClass()
14651489
{
14661490
return 'Gitlab\Api\Projects';

0 commit comments

Comments
 (0)