Skip to content

Commit 057688e

Browse files
committed
Replace covers-annotations with CoversClass Attribute
1 parent 14f6159 commit 057688e

File tree

89 files changed

+181
-690
lines changed

Some content is hidden

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

89 files changed

+181
-690
lines changed

tests/Integration/Psr18ClientRequestGenerationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use GuzzleHttp\Psr7\Request;
88
use GuzzleHttp\Psr7\Utils;
9+
use PHPUnit\Framework\Attributes\CoversClass;
910
use PHPUnit\Framework\Attributes\DataProvider;
1011
use PHPUnit\Framework\TestCase;
1112
use Psr\Http\Client\ClientInterface;
@@ -15,11 +16,10 @@
1516
use Psr\Http\Message\StreamInterface;
1617
use Redmine\Client\Psr18Client;
1718

19+
#[CoversClass(Psr18Client::class)]
1820
class Psr18ClientRequestGenerationTest extends TestCase
1921
{
2022
/**
21-
* @covers \Redmine\Client\Psr18Client
22-
*
2323
* @dataProvider createdGetRequestsData
2424
*/
2525
#[DataProvider('createdGetRequestsData')]

tests/Unit/Api/AbstractApi/DeleteTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44

55
namespace Redmine\Tests\Unit\Api\AbstractApi;
66

7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use PHPUnit\Framework\Attributes\DataProvider;
89
use PHPUnit\Framework\TestCase;
910
use Redmine\Api\AbstractApi;
1011
use Redmine\Client\Client;
1112
use Redmine\Tests\Fixtures\AssertingHttpClient;
1213
use ReflectionMethod;
1314

14-
/**
15-
* @covers \Redmine\Api\AbstractApi::delete
16-
*/
15+
#[CoversClass(AbstractApi::class)]
1716
class DeleteTest extends TestCase
1817
{
1918
public function testDeleteWithHttpClient()

tests/Unit/Api/AbstractApi/GetTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Redmine\Tests\Unit\Api\AbstractApi;
66

7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use PHPUnit\Framework\Attributes\DataProvider;
89
use PHPUnit\Framework\TestCase;
910
use Redmine\Api\AbstractApi;
@@ -12,9 +13,7 @@
1213
use ReflectionMethod;
1314
use SimpleXMLElement;
1415

15-
/**
16-
* @covers \Redmine\Api\AbstractApi::get
17-
*/
16+
#[CoversClass(AbstractApi::class)]
1817
class GetTest extends TestCase
1918
{
2019
public function testGetWithHttpClient()

tests/Unit/Api/AbstractApi/PostTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Redmine\Tests\Unit\Api\AbstractApi;
66

7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use PHPUnit\Framework\Attributes\DataProvider;
89
use PHPUnit\Framework\TestCase;
910
use Redmine\Api\AbstractApi;
@@ -12,9 +13,7 @@
1213
use ReflectionMethod;
1314
use SimpleXMLElement;
1415

15-
/**
16-
* @covers \Redmine\Api\AbstractApi::post
17-
*/
16+
#[CoversClass(AbstractApi::class)]
1817
class PostTest extends TestCase
1918
{
2019
public function testPostWithHttpClient()

tests/Unit/Api/AbstractApi/PutTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Redmine\Tests\Unit\Api\AbstractApi;
66

7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use PHPUnit\Framework\Attributes\DataProvider;
89
use PHPUnit\Framework\TestCase;
910
use Redmine\Api\AbstractApi;
@@ -12,9 +13,7 @@
1213
use ReflectionMethod;
1314
use SimpleXMLElement;
1415

15-
/**
16-
* @covers \Redmine\Api\AbstractApi::put
17-
*/
16+
#[CoversClass(AbstractApi::class)]
1817
class PutTest extends TestCase
1918
{
2019
public function testPutWithHttpClient()

tests/Unit/Api/AbstractApiTest.php

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Redmine\Tests\Unit\Api;
44

55
use InvalidArgumentException;
6+
use PHPUnit\Framework\Attributes\CoversClass;
67
use PHPUnit\Framework\Attributes\DataProvider;
78
use PHPUnit\Framework\TestCase;
89
use Redmine\Api\AbstractApi;
@@ -14,9 +15,7 @@
1415
use ReflectionMethod;
1516
use SimpleXMLElement;
1617

17-
/**
18-
* @coversDefaultClass \Redmine\Api\AbstractApi
19-
*/
18+
#[CoversClass(AbstractApi::class)]
2019
class AbstractApiTest extends TestCase
2120
{
2221
public function testCreateWithHttpClientWorks()
@@ -52,9 +51,6 @@ public function testCreateWithoutClitentOrHttpClientThrowsException()
5251
new class (new \stdClass()) extends AbstractApi {};
5352
}
5453

55-
/**
56-
* @covers ::get
57-
*/
5854
public function testGetTriggersDeprecationWarning()
5955
{
6056
$client = $this->createMock(HttpClient::class);
@@ -83,9 +79,6 @@ function ($errno, $errstr): bool {
8379
$api->runGet('/path.json');
8480
}
8581

86-
/**
87-
* @covers ::getLastResponse
88-
*/
8982
public function testGetLastResponseWithHttpClientWorks()
9083
{
9184
$client = $this->createMock(HttpClient::class);
@@ -95,9 +88,6 @@ public function testGetLastResponseWithHttpClientWorks()
9588
$this->assertInstanceOf(Response::class, $api->getLastResponse());
9689
}
9790

98-
/**
99-
* @covers ::post
100-
*/
10191
public function testPostTriggersDeprecationWarning()
10292
{
10393
$client = $this->createMock(HttpClient::class);
@@ -164,9 +154,6 @@ public static function getIsNotNullReturnsCorrectBooleanData(): array
164154
];
165155
}
166156

167-
/**
168-
* @covers ::lastCallFailed
169-
*/
170157
public function testLastCallFailedPreventsRaceCondition()
171158
{
172159
$client = AssertingHttpClient::create(
@@ -211,7 +198,6 @@ public function __construct($client)
211198
}
212199

213200
/**
214-
* @covers ::lastCallFailed
215201
* @dataProvider getLastCallFailedData
216202
*/
217203
#[DataProvider('getLastCallFailedData')]
@@ -226,7 +212,6 @@ public function testLastCallFailedWithClientReturnsCorrectBoolean($statusCode, $
226212
}
227213

228214
/**
229-
* @covers ::lastCallFailed
230215
* @dataProvider getLastCallFailedData
231216
*/
232217
#[DataProvider('getLastCallFailedData')]
@@ -321,8 +306,6 @@ public static function getLastCallFailedData(): array
321306
}
322307

323308
/**
324-
* @covers ::retrieveData
325-
*
326309
* @dataProvider retrieveDataData
327310
*/
328311
#[DataProvider('retrieveDataData')]
@@ -349,8 +332,6 @@ public static function retrieveDataData(): array
349332
}
350333

351334
/**
352-
* @covers ::retrieveData
353-
*
354335
* @dataProvider getRetrieveDataToExceptionData
355336
*/
356337
#[DataProvider('getRetrieveDataToExceptionData')]
@@ -380,8 +361,6 @@ public static function getRetrieveDataToExceptionData(): array
380361
}
381362

382363
/**
383-
* @covers ::retrieveAll
384-
*
385364
* @dataProvider getRetrieveAllData
386365
*/
387366
#[DataProvider('getRetrieveAllData')]
@@ -409,9 +388,6 @@ public static function getRetrieveAllData(): array
409388
];
410389
}
411390

412-
/**
413-
* @covers ::attachCustomFieldXML
414-
*/
415391
public function testDeprecatedAttachCustomFieldXML()
416392
{
417393
$client = $this->createMock(Client::class);

tests/Unit/Api/Attachment/DownloadTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
namespace Redmine\Tests\Unit\Api\Attachment;
44

5+
use PHPUnit\Framework\Attributes\CoversClass;
56
use PHPUnit\Framework\Attributes\DataProvider;
67
use PHPUnit\Framework\TestCase;
78
use Redmine\Api\Attachment;
89
use Redmine\Tests\Fixtures\AssertingHttpClient;
910

10-
/**
11-
* @covers \Redmine\Api\Attachment::download
12-
*/
11+
#[CoversClass(Attachment::class)]
1312
class DownloadTest extends TestCase
1413
{
1514
/**

tests/Unit/Api/Attachment/RemoveTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44

55
namespace Redmine\Tests\Unit\Api\Attachment;
66

7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use PHPUnit\Framework\TestCase;
89
use Redmine\Api\Attachment;
910
use Redmine\Tests\Fixtures\AssertingHttpClient;
1011

11-
/**
12-
* @covers \Redmine\Api\Attachment::remove
13-
*/
12+
#[CoversClass(Attachment::class)]
1413
class RemoveTest extends TestCase
1514
{
1615
public function testRemoveReturnsString()

tests/Unit/Api/Attachment/ShowTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
namespace Redmine\Tests\Unit\Api\Attachment;
44

5+
use PHPUnit\Framework\Attributes\CoversClass;
56
use PHPUnit\Framework\Attributes\DataProvider;
67
use PHPUnit\Framework\TestCase;
78
use Redmine\Api\Attachment;
89
use Redmine\Tests\Fixtures\AssertingHttpClient;
910

10-
/**
11-
* @covers \Redmine\Api\Attachment::show
12-
*/
11+
#[CoversClass(Attachment::class)]
1312
class ShowTest extends TestCase
1413
{
1514
/**

tests/Unit/Api/Attachment/UploadTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
namespace Redmine\Tests\Unit\Api\Attachment;
44

5+
use PHPUnit\Framework\Attributes\CoversClass;
56
use PHPUnit\Framework\Attributes\DataProvider;
67
use PHPUnit\Framework\TestCase;
78
use Redmine\Api\Attachment;
89
use Redmine\Tests\Fixtures\AssertingHttpClient;
910

10-
/**
11-
* @covers \Redmine\Api\Attachment::upload
12-
*/
11+
#[CoversClass(Attachment::class)]
1312
class UploadTest extends TestCase
1413
{
1514
/**

0 commit comments

Comments
 (0)