Skip to content

Commit 71e4d8e

Browse files
committed
refactor(): Replace "string" to IsType::TYPE_STRING in tests
1 parent 82719bd commit 71e4d8e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/Alezhu/PHPUnitArrayContainsAsserts/Constraint/ArrayContainsTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Alezhu\PHPUnitArrayContainsAsserts\Constraint\ArrayContains;
66
use PHPUnit\Framework\AssertionFailedError;
7+
use PHPUnit\Framework\Constraint\IsType;
78
use PHPUnit\Framework\ExpectationFailedException;
89
use PHPUnit\Framework\TestCase;
910
use SebastianBergmann\Exporter\Exporter;
@@ -36,7 +37,7 @@ public function test_matches_unassoc_should_be_valid_if_all_expected_values_in_r
3637

3738
public function test_matches_assoc_should_be_valid_if_all_expected_values_in_result()
3839
{
39-
$instance = new ArrayContains(["foo" => self::isType("string"), "bar" => 1]);
40+
$instance = new ArrayContains(["foo" => self::isType(IsType::TYPE_STRING), "bar" => 1]);
4041
$result = $instance->evaluate(["bar" => 1, "foo" => "value", "baz" => true], '', true);
4142
self::assertTrue($result);
4243
}
@@ -79,7 +80,7 @@ public function test_matches_assoc_should_raise_exception_if_some_of_expected_ke
7980
{
8081
$this->expectException(ExpectationFailedException::class);
8182
$result = ["bar" => "value"];
82-
$instance = new ArrayContains(["foo" => self::isType("string"), "bar" => 1]);
83+
$instance = new ArrayContains(["foo" => self::isType(IsType::TYPE_STRING), "bar" => 1]);
8384
$exporter = new Exporter();
8485
$this->expectExceptionMessage(
8586
sprintf(
@@ -95,7 +96,7 @@ public function test_matches_assoc_should_raise_exception_if_some_of_expected_va
9596
{
9697
$this->expectException(ExpectationFailedException::class);
9798
$result = ["bar" => "value", "foo" => "value"];
98-
$instance = new ArrayContains(["foo" => self::isType("string"), "bar" => 1]);
99+
$instance = new ArrayContains(["foo" => self::isType(IsType::TYPE_STRING), "bar" => 1]);
99100
$exporter = new Exporter();
100101
$this->expectExceptionMessage(
101102
sprintf(

0 commit comments

Comments
 (0)