33namespace Redmine \Tests \Unit \Api ;
44
55use InvalidArgumentException ;
6+ use PHPUnit \Framework \Attributes \CoversClass ;
67use PHPUnit \Framework \Attributes \DataProvider ;
78use PHPUnit \Framework \TestCase ;
89use Redmine \Api \AbstractApi ;
1415use ReflectionMethod ;
1516use SimpleXMLElement ;
1617
17- /**
18- * @coversDefaultClass \Redmine\Api\AbstractApi
19- */
18+ #[CoversClass(AbstractApi::class)]
2019class 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);
0 commit comments