Skip to content

Commit

Permalink
Add ruleset @PHPUnit84Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Art4 committed Oct 13, 2023
1 parent f155f88 commit 7c34c0d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
'@PER-CS2.0:risky' => true,
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@PHPUnit84Migration:risky' => true,
'no_alias_functions' => true,
])
->setFinder($finder)
->setRiskyAllowed(true)
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/V1/AttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public function testCreateWithObject(): void

$this->assertInstanceOf(Accessable::class, $attributes);
$this->assertTrue($attributes->has('object'));
$this->assertTrue(is_object($attributes->get('object')));
$this->assertIsObject($attributes->get('object'));
$this->assertTrue($attributes->has('array'));
$this->assertTrue(is_array($attributes->get('array')));
$this->assertIsArray($attributes->get('array'));
$this->assertTrue($attributes->has('string'));
$this->assertTrue(is_string($attributes->get('string')));
$this->assertIsString($attributes->get('string'));
$this->assertTrue($attributes->has('number_int'));
$this->assertTrue(is_int($attributes->get('number_int')));
$this->assertIsInt($attributes->get('number_int'));
$this->assertTrue($attributes->has('number_float'));
$this->assertTrue(is_float($attributes->get('number_float')));
$this->assertIsFloat($attributes->get('number_float'));
$this->assertTrue($attributes->has('true'));
$this->assertTrue($attributes->get('true'));
$this->assertTrue($attributes->has('false'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/V1/JsonapiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ public function testVersionCannotBeAnObjectOrArray($input): void

// other input must be transformed to string
$this->assertTrue($jsonapi->has('version'));
$this->assertTrue(is_string($jsonapi->get('version')));
$this->assertIsString($jsonapi->get('version'));
}
}
2 changes: 1 addition & 1 deletion tests/Unit/V1/LinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testHrefHasToBeAString($input): void
$link = new Link($object, $this->manager, $this->parent);

$this->assertTrue($link->has('href'));
$this->assertTrue(is_string($link->get('href')));
$this->assertIsString($link->get('href'));

return;
}
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/V1/MetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public function testCreateWithObject(): void

$this->assertInstanceOf(Accessable::class, $meta);
$this->assertTrue($meta->has('object'));
$this->assertTrue(is_object($meta->get('object')));
$this->assertIsObject($meta->get('object'));
$this->assertTrue($meta->has('array'));
$this->assertTrue(is_array($meta->get('array')));
$this->assertIsArray($meta->get('array'));
$this->assertTrue($meta->has('string'));
$this->assertTrue(is_string($meta->get('string')));
$this->assertIsString($meta->get('string'));
$this->assertTrue($meta->has('number_int'));
$this->assertTrue(is_int($meta->get('number_int')));
$this->assertIsInt($meta->get('number_int'));
$this->assertTrue($meta->has('number_float'));
$this->assertTrue(is_float($meta->get('number_float')));
$this->assertIsFloat($meta->get('number_float'));
$this->assertTrue($meta->has('true'));
$this->assertTrue($meta->get('true'));
$this->assertTrue($meta->has('false'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/V1/RelationshipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function testCreateWithDataNull(): void
$this->assertSame($relationship->getKeys(), ['data']);
$this->assertTrue($relationship->has('data'));

$this->assertTrue(is_null($relationship->get('data')));
$this->assertNull($relationship->get('data'));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/V1/ResourceIdentifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function testTypeMustBeAString($input): void

$identifier = new ResourceIdentifier($object, $this->manager, $this->parent);

$this->assertTrue(is_string($identifier->get('type')));
$this->assertIsString($identifier->get('type'));
}

/**
Expand Down

0 comments on commit 7c34c0d

Please sign in to comment.