1212 */
1313class JsonTypeTest extends PHPUnit_Framework_TestCase
1414{
15- protected function createJsonType ()
15+ protected function createValidator ()
1616 {
1717 return new Validator ();
1818 }
@@ -23,7 +23,7 @@ public function basicTypes()
2323 ['string ' , 'foobar ' , true ],
2424 ['string ' , 123 , false ],
2525 ['integer ' , 123 , true ],
26- ['float ' , 123.1 , true ],
26+ ['double ' , 123.1 , true ],
2727
2828 ['number ' , 123.1 , true ],
2929 ['number ' , 234 , true ],
@@ -44,7 +44,7 @@ public function basicTypes()
4444 */
4545 public function testMatchBasicTypes ($ type , $ data , $ result )
4646 {
47- $ json = $ this ->createJsonType ();
47+ $ json = $ this ->createValidator ();
4848
4949 $ method = $ result ? 'assertTrue ' : 'assertFalse ' ;
5050
@@ -73,7 +73,7 @@ protected function userData()
7373
7474 public function testMatchCustomType ()
7575 {
76- $ json = $ this ->createJsonType ();
76+ $ json = $ this ->createValidator ();
7777
7878 $ json ->addType ('user ' , $ this ->userType ());
7979
@@ -83,7 +83,7 @@ public function testMatchCustomType()
8383
8484 public function testMatchArrayOfCustomType ()
8585 {
86- $ json = $ this ->createJsonType ();
86+ $ json = $ this ->createValidator ();
8787
8888 $ json ->addType ('user ' , $ this ->userType ());
8989
@@ -92,7 +92,7 @@ public function testMatchArrayOfCustomType()
9292
9393 public function testAddCustomTypeThroughCallable ()
9494 {
95- $ json = $ this ->createJsonType ();
95+ $ json = $ this ->createValidator ();
9696
9797 $ json ->addType ('timestamp ' , function ($ value ) {
9898 if ((!is_string ($ value ) && !is_numeric ($ value )) || strtotime ($ value ) === false ) {
@@ -174,7 +174,7 @@ public function typeErrorMessages()
174174 */
175175 public function testErrorMessages ($ value , $ type , $ key , $ message )
176176 {
177- $ json = $ this ->createJsonType ();
177+ $ json = $ this ->createValidator ();
178178
179179 $ this ->assertFalse ($ json ->matches ($ value , $ type ));
180180 $ this ->assertEquals ($ message , $ json ->getErrors ()[$ key ] ?? '' );
0 commit comments