Skip to content

Commit a73bbaf

Browse files
committed
Use attributes in phpunit tests
1 parent 51f9780 commit a73bbaf

7 files changed

+55
-86
lines changed

phpstan.neon

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ parameters:
1414
- %currentWorkingDirectory%/test/
1515
- %currentWorkingDirectory%/.build/
1616

17-
# Ignored validations
18-
checkGenericClassInNonGenericObjectType: false
17+
ignoreErrors:
18+
-
19+
identifier: missingType.generics

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
SetList::CODING_STYLE,
4545
SetList::CODE_QUALITY,
4646
SetList::DEAD_CODE,
47-
LevelSetList::UP_TO_PHP_74,
47+
LevelSetList::UP_TO_PHP_81,
4848
]);
4949

5050
// Skip some rules

src/JsonMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ private function getReflectionProperty(string $className, string $propertyName):
302302
{
303303
try {
304304
return new ReflectionProperty($className, $propertyName);
305-
} catch (ReflectionException $exception) {
305+
} catch (ReflectionException) {
306306
return null;
307307
}
308308
}

test/Annotation/ReplacePropertyTest.php

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

1414
use MagicSunday\Test\Classes\ReplacePropertyTestClass;
1515
use MagicSunday\Test\TestCase;
16+
use PHPUnit\Framework\Attributes\Test;
1617

1718
/**
1819
* Class ReplacePropertyTest.
@@ -25,9 +26,8 @@ class ReplacePropertyTest extends TestCase
2526
{
2627
/**
2728
* Tests replacing a property.
28-
*
29-
* @test
3029
*/
30+
#[Test]
3131
public function replaceProperty(): void
3232
{
3333
$result = $this->getJsonMapper()

test/Converter/CamelCasePropertyNameConverterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace MagicSunday\Test\Converter;
1313

1414
use MagicSunday\JsonMapper\Converter\CamelCasePropertyNameConverter;
15+
use PHPUnit\Framework\Attributes\Test;
1516
use PHPUnit\Framework\TestCase;
1617

1718
/**
@@ -25,9 +26,8 @@ class CamelCasePropertyNameConverterTest extends TestCase
2526
{
2627
/**
2728
* Tests mapping json properties to camel case.
28-
*
29-
* @test
3029
*/
30+
#[Test]
3131
public function checkCamelCasePropertyNameConverter(): void
3232
{
3333
$converter = new CamelCasePropertyNameConverter();

0 commit comments

Comments
 (0)