Skip to content

Commit 15afa14

Browse files
WIP
1 parent 87fa5f5 commit 15afa14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+572
-1945
lines changed

tests/Api/DeployKeysTest.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
namespace Gitlab\Tests\Api;
1616

17+
use PHPUnit\Framework\Attributes\Test;
1718
use Gitlab\Api\DeployKeys;
1819

1920
class DeployKeysTest extends TestCase
2021
{
21-
/**
22-
* @test
23-
*/
22+
#[Test]
2423
public function shouldGetAllDeployKeys(): void
2524
{
2625
$expectedArray = $this->getMultipleDeployKeysData();

tests/Api/DeploymentsTest.php

+7-23
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
namespace Gitlab\Tests\Api;
1616

17+
use PHPUnit\Framework\Attributes\Test;
1718
use Gitlab\Api\Deployments;
1819

1920
class DeploymentsTest extends TestCase
2021
{
21-
/**
22-
* @test
23-
*/
22+
#[Test]
2423
public function shouldGetAllDeployments(): void
2524
{
2625
$expectedArray = $this->getMultipleDeploymentsData();
@@ -29,10 +28,7 @@ public function shouldGetAllDeployments(): void
2928

3029
$this->assertEquals($expectedArray, $api->all(1));
3130
}
32-
33-
/**
34-
* @test
35-
*/
31+
#[Test]
3632
public function shouldShowDeployment(): void
3733
{
3834
$expectedArray = [
@@ -254,10 +250,7 @@ protected function getMultipleDeploymentsRequestMock(string $path, array $expect
254250

255251
return $api;
256252
}
257-
258-
/**
259-
* @test
260-
*/
253+
#[Test]
261254
public function shouldGetAllDeploymentsSortedByCreatedAt(): void
262255
{
263256
$expectedArray = $this->getMultipleDeploymentsData();
@@ -278,10 +271,7 @@ protected function getApiClass()
278271
{
279272
return Deployments::class;
280273
}
281-
282-
/**
283-
* @test
284-
*/
274+
#[Test]
285275
public function shouldAllowDeploymentFilterByStatus(): void
286276
{
287277
$expectedArray = $this->getMultipleDeploymentsData();
@@ -297,10 +287,7 @@ public function shouldAllowDeploymentFilterByStatus(): void
297287
$api->all(1, ['status' => 'success'])
298288
);
299289
}
300-
301-
/**
302-
* @test
303-
*/
290+
#[Test]
304291
public function shouldAllowFilterByEnvironment(): void
305292
{
306293
$expectedArray = $this->getMultipleDeploymentsData();
@@ -316,10 +303,7 @@ public function shouldAllowFilterByEnvironment(): void
316303
$api->all(1, ['environment' => 'production'])
317304
);
318305
}
319-
320-
/**
321-
* @test
322-
*/
306+
#[Test]
323307
public function shouldAllowEmptyArrayIfAllExcludedByFilter(): void
324308
{
325309
$expectedArray = $this->getMultipleDeploymentsData();

tests/Api/EnvironmentsTest.php

+6-19
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
namespace Gitlab\Tests\Api;
1616

17+
use PHPUnit\Framework\Attributes\Test;
1718
use Gitlab\Api\Environments;
1819

1920
class EnvironmentsTest extends TestCase
2021
{
21-
/**
22-
* @test
23-
*/
22+
#[Test]
2423
public function shouldGetAllEnvironments(): void
2524
{
2625
$expectedArray = [
@@ -64,10 +63,7 @@ public function shouldFilterEnvironmentByName(): void
6463
->willReturn($expected);
6564
$this->assertEquals($expected, $api->all(1, ['name' => 'review/fix-bar']));
6665
}
67-
68-
/**
69-
* @test
70-
*/
66+
#[Test]
7167
public function shouldGetSingleEnvironment(): void
7268
{
7369
$expected = [
@@ -143,10 +139,7 @@ public function shouldGetSingleEnvironment(): void
143139
->willReturn($expected);
144140
$this->assertEquals($expected, $api->show(1, 1));
145141
}
146-
147-
/**
148-
* @test
149-
*/
142+
#[Test]
150143
public function shouldCreateEnvironment(): void
151144
{
152145
$expectedArray = [
@@ -173,10 +166,7 @@ public function shouldCreateEnvironment(): void
173166

174167
$this->assertEquals($expectedArray, $api->create(1, $params));
175168
}
176-
177-
/**
178-
* @test
179-
*/
169+
#[Test]
180170
public function shouldRemoveEnvironment(): void
181171
{
182172
$expectedBool = true;
@@ -188,10 +178,7 @@ public function shouldRemoveEnvironment(): void
188178
->willReturn($expectedBool);
189179
$this->assertEquals($expectedBool, $api->remove(1, 3));
190180
}
191-
192-
/**
193-
* @test
194-
*/
181+
#[Test]
195182
public function shouldStopEnvironment(): void
196183
{
197184
$expectedBool = true;

tests/Api/EventsTest.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Gitlab\Tests\Api;
1515

16+
use PHPUnit\Framework\Attributes\Test;
1617
use Gitlab\Api\Events;
1718

1819
class EventsTest extends TestCase
@@ -21,10 +22,7 @@ protected function getApiClass()
2122
{
2223
return Events::class;
2324
}
24-
25-
/**
26-
* @test
27-
*/
25+
#[Test]
2826
public function shouldGetAllEvents(): void
2927
{
3028
$expectedArray = [
@@ -41,10 +39,7 @@ public function shouldGetAllEvents(): void
4139

4240
$this->assertEquals($expectedArray, $api->all());
4341
}
44-
45-
/**
46-
* @test
47-
*/
42+
#[Test]
4843
public function shouldGetEventsAfter(): void
4944
{
5045
$expectedArray = [

tests/Api/GroupBoardsTest.php

+11-39
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
namespace Gitlab\Tests\Api;
1616

17+
use PHPUnit\Framework\Attributes\Test;
1718
use Gitlab\Api\GroupsBoards;
1819

1920
class GroupBoardsTest extends TestCase
2021
{
21-
/**
22-
* @test
23-
*/
22+
#[Test]
2423
public function shouldGetAllBoards(): void
2524
{
2625
$expectedArray = [
@@ -37,10 +36,7 @@ public function shouldGetAllBoards(): void
3736

3837
$this->assertEquals($expectedArray, $api->all());
3938
}
40-
41-
/**
42-
* @test
43-
*/
39+
#[Test]
4440
public function shouldShowIssueBoard(): void
4541
{
4642
$expectedArray = ['id' => 2, 'name' => 'Another issue board'];
@@ -54,10 +50,7 @@ public function shouldShowIssueBoard(): void
5450

5551
$this->assertEquals($expectedArray, $api->show(1, 2));
5652
}
57-
58-
/**
59-
* @test
60-
*/
53+
#[Test]
6154
public function shouldCreateIssueBoard(): void
6255
{
6356
$expectedArray = ['id' => 3, 'name' => 'A new issue board'];
@@ -71,10 +64,7 @@ public function shouldCreateIssueBoard(): void
7164

7265
$this->assertEquals($expectedArray, $api->create(1, ['name' => 'A new issue board']));
7366
}
74-
75-
/**
76-
* @test
77-
*/
67+
#[Test]
7868
public function shouldUpdateIssueBoard(): void
7969
{
8070
$expectedArray = ['id' => 2, 'name' => 'A renamed issue board'];
@@ -88,10 +78,7 @@ public function shouldUpdateIssueBoard(): void
8878

8979
$this->assertEquals($expectedArray, $api->update(1, 2, ['name' => 'A renamed issue board', 'labels' => 'foo']));
9080
}
91-
92-
/**
93-
* @test
94-
*/
81+
#[Test]
9582
public function shouldRemoveIssueBoard(): void
9683
{
9784
$expectedBool = true;
@@ -104,10 +91,7 @@ public function shouldRemoveIssueBoard(): void
10491

10592
$this->assertEquals($expectedBool, $api->remove(1, 2));
10693
}
107-
108-
/**
109-
* @test
110-
*/
94+
#[Test]
11195
public function shouldGetAllLists(): void
11296
{
11397
$expectedArray = [
@@ -139,10 +123,7 @@ public function shouldGetAllLists(): void
139123

140124
$this->assertEquals($expectedArray, $api->allLists(1, 2));
141125
}
142-
143-
/**
144-
* @test
145-
*/
126+
#[Test]
146127
public function shouldGetList(): void
147128
{
148129
$expectedArray = [
@@ -166,10 +147,7 @@ public function shouldGetList(): void
166147

167148
$this->assertEquals($expectedArray, $api->showList(1, 2, 3));
168149
}
169-
170-
/**
171-
* @test
172-
*/
150+
#[Test]
173151
public function shouldCreateList(): void
174152
{
175153
$expectedArray = [
@@ -193,10 +171,7 @@ public function shouldCreateList(): void
193171

194172
$this->assertEquals($expectedArray, $api->createList(1, 2, 4));
195173
}
196-
197-
/**
198-
* @test
199-
*/
174+
#[Test]
200175
public function shouldUpdateList(): void
201176
{
202177
$expectedArray = [
@@ -220,10 +195,7 @@ public function shouldUpdateList(): void
220195

221196
$this->assertEquals($expectedArray, $api->updateList(5, 2, 3, 1));
222197
}
223-
224-
/**
225-
* @test
226-
*/
198+
#[Test]
227199
public function shouldDeleteList(): void
228200
{
229201
$expectedBool = true;

tests/Api/GroupsEpicsTest.php

+7-23
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414

1515
namespace Gitlab\Tests\Api;
1616

17+
use PHPUnit\Framework\Attributes\Test;
1718
use Gitlab\Api\GroupsEpics;
1819

1920
class GroupsEpicsTest extends TestCase
2021
{
21-
/**
22-
* @test
23-
*/
22+
#[Test]
2423
public function shouldGetAllEpics(): void
2524
{
2625
$expectedArray = [
@@ -37,10 +36,7 @@ public function shouldGetAllEpics(): void
3736

3837
$this->assertEquals($expectedArray, $api->all(1));
3938
}
40-
41-
/**
42-
* @test
43-
*/
39+
#[Test]
4440
public function shouldShowEpic(): void
4541
{
4642
$expectedArray = ['id' => 1, 'name' => 'A epic'];
@@ -54,10 +50,7 @@ public function shouldShowEpic(): void
5450

5551
$this->assertEquals($expectedArray, $api->show(1, 2));
5652
}
57-
58-
/**
59-
* @test
60-
*/
53+
#[Test]
6154
public function shouldCreateEpic(): void
6255
{
6356
$expectedArray = ['id' => 3, 'title' => 'A new epic'];
@@ -71,10 +64,7 @@ public function shouldCreateEpic(): void
7164

7265
$this->assertEquals($expectedArray, $api->create(1, ['description' => 'Some text', 'title' => 'A new epic']));
7366
}
74-
75-
/**
76-
* @test
77-
*/
67+
#[Test]
7868
public function shouldUpdateEpic(): void
7969
{
8070
$expectedArray = ['id' => 3, 'title' => 'Updated epic'];
@@ -88,10 +78,7 @@ public function shouldUpdateEpic(): void
8878

8979
$this->assertEquals($expectedArray, $api->update(1, 3, ['title' => 'Updated epic', 'description' => 'Updated description', 'state_event' => 'close']));
9080
}
91-
92-
/**
93-
* @test
94-
*/
81+
#[Test]
9582
public function shouldRemoveEpic(): void
9683
{
9784
$expectedBool = true;
@@ -104,10 +91,7 @@ public function shouldRemoveEpic(): void
10491

10592
$this->assertEquals($expectedBool, $api->remove(1, 2));
10693
}
107-
108-
/**
109-
* @test
110-
*/
94+
#[Test]
11195
public function shouldGetEpicsIssues(): void
11296
{
11397
$expectedArray = [

0 commit comments

Comments
 (0)