55
66class JsonPointerTest extends \PHPUnit \Framework \TestCase
77{
8- public function encodeDecodeData ()
8+ public static function encodeDecodeData ()
99 {
1010 return [
1111 ['~0 ' , '~ ' ],
@@ -41,7 +41,7 @@ public function testDecode($encoded, $decoded)
4141 /**
4242 * @link https://tools.ietf.org/html/rfc6901#section-5
4343 */
44- public function rfcJsonDocument ()
44+ public static function rfcJsonDocument ()
4545 {
4646 return <<<JSON
4747{
@@ -63,10 +63,10 @@ public function rfcJsonDocument()
6363 /**
6464 * @link https://tools.ietf.org/html/rfc6901#section-5
6565 */
66- public function rfcExamples ()
66+ public static function rfcExamples ()
6767 {
6868 $ return = [
69- ["" , "# " , json_decode ($ this -> rfcJsonDocument ())],
69+ ["" , "# " , json_decode (self :: rfcJsonDocument ())],
7070 ["/foo " , "#/foo " , ["bar " , "baz " ]],
7171 ["/foo/0 " , "#/foo/0 " , "bar " ],
7272 ["/ " , "#/ " , 0 ],
@@ -80,14 +80,14 @@ public function rfcExamples()
8080 ["/m~0n " , "#/m~0n " , 8 ],
8181 ];
8282 foreach ($ return as $ example ) {
83- $ example [3 ] = $ this -> rfcJsonDocument ();
83+ $ example [3 ] = self :: rfcJsonDocument ();
8484 yield $ example ;
8585 }
8686 }
8787
88- public function allExamples ()
88+ public static function allExamples ()
8989 {
90- yield from $ this -> rfcExamples ();
90+ yield from self :: rfcExamples ();
9191
9292 yield ["/a#b " , "#/a%23b " , 16 , '{"a#b": 16} ' ];
9393 }
@@ -117,11 +117,11 @@ public function testUriEncoding($jsonPointer, $uriJsonPointer, $expectedEvaluati
117117 */
118118 public function testEvaluation ($ jsonPointer , $ uriJsonPointer , $ expectedEvaluation )
119119 {
120- $ document = json_decode ($ this -> rfcJsonDocument ());
120+ $ document = json_decode (self :: rfcJsonDocument ());
121121 $ pointer = new JsonPointer ($ jsonPointer );
122122 $ this ->assertEquals ($ expectedEvaluation , $ pointer ->evaluate ($ document ));
123123
124- $ document = json_decode ($ this -> rfcJsonDocument ());
124+ $ document = json_decode (self :: rfcJsonDocument ());
125125 $ reference = JsonReference::createFromReference ($ uriJsonPointer );
126126 $ this ->assertEquals ($ expectedEvaluation , $ reference ->getJsonPointer ()->evaluate ($ document ));
127127 }
0 commit comments