44use Helmich \JsonAssert \Constraint \JsonValueMatches ;
55use Helmich \JsonAssert \Constraint \JsonValueMatchesMany ;
66use Helmich \JsonAssert \Constraint \JsonValueMatchesSchema ;
7- use PHPUnit_Framework_Assert as Assert ;
8- use PHPUnit_Framework_Constraint as Constraint ;
7+ use PHPUnit \Framework \Assert ;
8+ use PHPUnit \Framework \Constraint \Constraint ;
9+ use PHPUnit \Framework \Constraint \IsEqual ;
910
1011/**
1112 * A trait that can be used in test classes for easy use of JSON assertions
@@ -28,7 +29,7 @@ trait JsonAssertions
2829 * must match
2930 * @return void
3031 */
31- public static function assertJsonValueMatches ($ jsonDocument , $ jsonPath , Constraint $ constraint )
32+ public static function assertJsonValueMatches ($ jsonDocument , string $ jsonPath , Constraint $ constraint )
3233 {
3334 Assert::assertThat ($ jsonDocument , new JsonValueMatches ($ jsonPath , $ constraint ));
3435 }
@@ -46,7 +47,7 @@ public static function assertJsonValueMatches($jsonDocument, $jsonPath, Constrai
4647 * must match
4748 * @return void
4849 */
49- public static function assertAllJsonValuesMatch ($ jsonDocument , $ jsonPath , Constraint $ constraint )
50+ public static function assertAllJsonValuesMatch ($ jsonDocument , string $ jsonPath , Constraint $ constraint )
5051 {
5152 Assert::assertThat ($ jsonDocument , new JsonValueMatches ($ jsonPath , $ constraint , true ));
5253 }
@@ -63,12 +64,12 @@ public static function assertAllJsonValuesMatch($jsonDocument, $jsonPath, Constr
6364 * equal to.
6465 * @return void
6566 */
66- public static function assertJsonValueEquals ($ jsonDocument , $ jsonPath , $ expectedValue )
67+ public static function assertJsonValueEquals ($ jsonDocument , string $ jsonPath , $ expectedValue )
6768 {
6869 static ::assertJsonValueMatches (
6970 $ jsonDocument ,
7071 $ jsonPath ,
71- new \ PHPUnit_Framework_Constraint_IsEqual ($ expectedValue )
72+ new IsEqual ($ expectedValue )
7273 );
7374 }
7475
@@ -85,12 +86,12 @@ public static function assertJsonValueEquals($jsonDocument, $jsonPath, $expected
8586 * equal to.
8687 * @return void
8788 */
88- public static function assertAllJsonValuesEqual ($ jsonDocument , $ jsonPath , $ expectedValue )
89+ public static function assertAllJsonValuesEqual ($ jsonDocument , string $ jsonPath , $ expectedValue )
8990 {
9091 static ::assertAllJsonValuesMatch (
9192 $ jsonDocument ,
9293 $ jsonPath ,
93- new \ PHPUnit_Framework_Constraint_IsEqual ($ expectedValue )
94+ new IsEqual ($ expectedValue )
9495 );
9596 }
9697
0 commit comments