Skip to content

Commit dc64dfb

Browse files
committedFeb 23, 2025
Allow PHPUnit 11
1 parent c597d3a commit dc64dfb

10 files changed

+7
-28
lines changed
 

‎tests/Api/EnvironmentsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function shouldGetAllEnvironments(): void
4545
$this->assertEquals($expectedArray, $api->all(1));
4646
}
4747

48-
/** @test */
48+
#[Test]
4949
public function shouldFilterEnvironmentByName(): void
5050
{
5151
$expected = [

‎tests/Api/GroupsMilestonesTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Gitlab\Api\GroupsMilestones;
1818
use PHPUnit\Framework\Attributes\DataProvider;
1919
use PHPUnit\Framework\Attributes\Test;
20-
use PHPUnit\Framework\Attributes\Test;
2120

2221
class GroupsMilestonesTest extends TestCase
2322
{

‎tests/Api/GroupsTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use DateTime;
1818
use Gitlab\Api\Groups;
1919
use PHPUnit\Framework\Attributes\Test;
20-
use PHPUnit\Framework\Attributes\Test;
2120

2221
class GroupsTest extends TestCase
2322
{

‎tests/Api/JobsTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Gitlab\Api\Jobs;
1818
use GuzzleHttp\Psr7\Response;
1919
use PHPUnit\Framework\Attributes\Test;
20-
use PHPUnit\Framework\Attributes\Test;
2120

2221
class JobsTest extends TestCase
2322
{

‎tests/Api/ProjectsTest.php

+3-17
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
use Gitlab\Api\Projects;
1919
use PHPUnit\Framework\Attributes\DataProvider;
2020
use PHPUnit\Framework\Attributes\Test;
21-
use PHPUnit\Framework\Attributes\Test;
22-
use PHPUnit\Framework\Attributes\Test;
2321

2422
class ProjectsTest extends TestCase
2523
{
@@ -399,11 +397,7 @@ public function shouldGetTrigger(): void
399397
$this->assertEquals($expectedArray, $api->trigger(1, 3));
400398
}
401399

402-
/**
403-
* Check we can request project issues.
404-
*
405-
* @test
406-
*/
400+
#[Test]
407401
public function shouldGetProjectIssues(): void
408402
{
409403
$expectedArray = $this->getProjectIssuesExpectedArray();
@@ -417,11 +411,7 @@ public function shouldGetProjectIssues(): void
417411
$this->assertEquals($expectedArray, $api->issues(1));
418412
}
419413

420-
/**
421-
* Check we can request project issues.
422-
*
423-
* @test
424-
*/
414+
#[Test]
425415
public function shouldGetProjectUsers(): void
426416
{
427417
$expectedArray = $this->getProjectUsersExpectedArray();
@@ -435,11 +425,7 @@ public function shouldGetProjectUsers(): void
435425
$this->assertEquals($expectedArray, $api->users(1));
436426
}
437427

438-
/**
439-
* Check we can request project issues with query parameters.
440-
*
441-
* @test
442-
*/
428+
#[Test]
443429
public function shouldGetProjectIssuesParameters(): void
444430
{
445431
$expectedArray = $this->getProjectIssuesExpectedArray();

‎tests/Api/RepositoriesTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Gitlab\Api\Repositories;
1818
use PHPUnit\Framework\Attributes\DataProvider;
1919
use PHPUnit\Framework\Attributes\Test;
20-
use PHPUnit\Framework\Attributes\Test;
2120

2221
class RepositoriesTest extends TestCase
2322
{

‎tests/Api/TagsTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Gitlab\Api\Tags;
1818
use PHPUnit\Framework\Attributes\DataProvider;
1919
use PHPUnit\Framework\Attributes\Test;
20-
use PHPUnit\Framework\Attributes\Test;
2120

2221
class TagsTest extends TestCase
2322
{

‎tests/Api/UsersTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Gitlab\Api\Users;
1818
use PHPUnit\Framework\Attributes\DataProvider;
1919
use PHPUnit\Framework\Attributes\Test;
20-
use PHPUnit\Framework\Attributes\Test;
2120

2221
class UsersTest extends TestCase
2322
{

‎tests/HttpClient/BuilderTest.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Psr\Http\Client\ClientInterface;
2222
use Psr\Http\Message\RequestFactoryInterface;
2323
use Psr\Http\Message\StreamFactoryInterface;
24+
use PHPUnit\Framework\Attributes\Before;
2425

2526
/**
2627
* @author Fabien Bourigault <bourigaultfabien@gmail.com>
@@ -32,9 +33,7 @@ class BuilderTest extends TestCase
3233
*/
3334
private $subject;
3435

35-
/**
36-
* @before
37-
*/
36+
#[Before]
3837
public function initBuilder(): void
3938
{
4039
$this->subject = new Builder(

‎vendor-bin/phpunit/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"php": "^8.1",
4-
"phpunit/phpunit": "^10.5.45"
4+
"phpunit/phpunit": "^10.5.45 || ^11.5.9"
55
},
66
"config": {
77
"preferred-install": "dist"

0 commit comments

Comments
 (0)