Skip to content

Commit f23986d

Browse files
authored
Merge pull request #564 from netglue/phpunit-meta
Convert PHPUnit annotations to attributes
2 parents 8bcc014 + e1f6289 commit f23986d

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

test/Unit/Document/Fragment/DocumentLinkTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testConstructor(): DocumentLink
4040
return $link;
4141
}
4242

43-
/** @depends testConstructor */
43+
#[Depends('testConstructor')]
4444
public function testThatCastingALinkToAStringWillYieldItsId(DocumentLink $link): void
4545
{
4646
self::assertSame('id', (string) $link);
@@ -105,13 +105,13 @@ public function testThatTagsHaveExpectedMembers(DocumentLink $link): void
105105
$this->assertContainsEquals('b', $link->tags());
106106
}
107107

108-
/** @depends testConstructor */
108+
#[Depends('testConstructor')]
109109
public function testTheLinkMayHaveAUrlAndItIsNullByDefault(DocumentLink $link): void
110110
{
111111
self::assertNull($link->url());
112112
}
113113

114-
/** @depends testConstructorWithUrl */
114+
#[Depends('testConstructorWithUrl')]
115115
public function testThatUrlReturnsTheExpectedValue(DocumentLink $link): void
116116
{
117117
self::assertSame('/some/url', $link->url());

test/Unit/Document/Fragment/FactoryTest.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public static function documentLinkProvider(): array
333333
];
334334
}
335335

336-
/** @dataProvider documentLinkProvider */
336+
#[DataProvider('documentLinkProvider')]
337337
public function testThatDocumentLinksWithReadyMadeUrlsWillHaveTheExpectedValue(string $json, string|null $expect): void
338338
{
339339
$data = Json::decodeObject($json);
@@ -342,11 +342,8 @@ public function testThatDocumentLinksWithReadyMadeUrlsWillHaveTheExpectedValue(s
342342
self::assertSame($expect, $link->url());
343343
}
344344

345-
/**
346-
* @param class-string $expectedType
347-
*
348-
* @dataProvider scalarTypes
349-
*/
345+
/** @param class-string $expectedType */
346+
#[DataProvider('scalarTypes')]
350347
public function testThatTheFactoryCanBeNewedAndInvoked(string|int|float|bool|null $value, string $expectedType): void
351348
{
352349
$factory = new Factory();

0 commit comments

Comments
 (0)