ZF2-45: Zend/Rest/RouteTest

Description

Using phpunit 3.5.14, assertType is throwing deprecation errors.

The following is the error message given by phpunit --verbose:

Deprecated PHPUnit features are being usedzf2/tests/Zend/Rest/RouteTest.php:(between 77 and 101) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 103 and 113) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 118 and 128) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 130 and 140) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 142 and 154) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 156 and 168) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 170 and 181) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 183 and 194) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 196 and 207) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 209 and 220) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 222 and 233) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 235 and 245) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 247 and 258) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 260 and 271) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 273 and 284) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 286 and 298) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 320 and 331) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 333 and 344) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 346 and 357) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 368 and 380) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 382 and 394) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 396 and 407) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 427 and 438) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 440 and 451) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 480 and 492) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

zf2/tests/Zend/Rest/RouteTest.php:(between 494 and 506) - () will be removed in PHPUnit 3.6 and should no longer be used. assertInternalType() should be used for asserting internal types such as "integer" or "string" whereas assertInstanceOf() should be used for asserting that an object is an instance of a specified class or interface.

Comments

ZF1 standardizes on the PHPUnit 3.4 series; these deprecation notices were introduced during the PHPUnit 3.5 series. (ZF2 uses PHPUnit 3.5, and we're steadily updating these assertions.)

I thought I submitted this bug for ZF2. I also submitted a patch updating the assertions for ZF2. I created this bug in order to have a branch name to pull request for.

https://github.com/zendframework/zf2/…

Did I do this incorrectly?

My bad -- I missed the ZF2- prefix!

BTW, this route may or may not exist once refactoring of the MVC is done. The reason is that it may be easier to handle the request-method-specific items within the controller itself rather than in the routing. This allows using literal route matching, which will be much faster, and also more flexible for cases of subresources, etc.

That said, I'll still honor the pull request.

Awesome,

I was worried I had done something wrong. This is the first time I've publicly contributed to a project, and was using this ticket as my first try and working with a setup like this. I picked the easiest thing I could quickly find, just to get familiar with the process.

The pull request for this one https://github.com/zendframework/zf2/pull/313 was merged and closed, so I'm resolving this one as fixed. Also, the Zend/Rest tests are all green.