diff --git a/tests/Constraints/CoerciveTest.php b/tests/Constraints/CoerciveTest.php index 9a910c8a..8d58a58d 100644 --- a/tests/Constraints/CoerciveTest.php +++ b/tests/Constraints/CoerciveTest.php @@ -178,17 +178,14 @@ public function testCoerceCases($schema, $data, $startType, $endType, $endValue, // check end value $value = LooseTypeCheck::propertyGet($data, 'propertyOne'); - $this->assertTrue( - $value === $endValue, - sprintf( - "Incorrect value '%s': expected '%s'", - is_scalar($value) ? $value : gettype($value), - is_scalar($endValue) ? $endValue : gettype($endValue) - ) - ); + $this->assertSame($value, $endValue, sprintf( + "Incorrect value '%s': expected '%s'", + is_scalar($value) ? $value : gettype($value), + is_scalar($endValue) ? $endValue : gettype($endValue) + )); } else { $this->assertFalse($validator->isValid(), 'Validation succeeded, but should have failed'); - $this->assertEquals(1, count($validator->getErrors())); + $this->assertCount(1, $validator->getErrors()); } } diff --git a/tests/Constraints/FormatTest.php b/tests/Constraints/FormatTest.php index b035aafe..78706c33 100644 --- a/tests/Constraints/FormatTest.php +++ b/tests/Constraints/FormatTest.php @@ -77,7 +77,7 @@ public function testInvalidFormat($string, $format) $schema->format = $format; $validator->check($string, $schema); - $this->assertEquals(1, count($validator->getErrors()), 'Expected 1 error'); + $this->assertCount(1, $validator->getErrors(), 'Expected 1 error'); } /**