ZF-10849: PHPUnit showing deprecated warning on use of assertType() in PHPUnit 3.5.6 against current unit tests
Latest update to PHPUnit 3.5.6 causes the following messages to be repeated many times when running the test suite:
assertType() 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.
Since it seems we are now supporting the use of both PHPUnit 3.4 and PHPUnit 3.5 for ZF1 tests (see ZF-10830, ZF-10844), what is the best solution here? My suggestion to maintain compatibility with PHPUnit 3.4 is to replace $this->assertType('ExpectedClass', $actualObject) with $this->assertTrue($actualObject instanceof ExpectedClass). But, the downside is that you lose some verbosity on the reason for a test failure on these assertions without manually digging into the test code.
Any better suggestions?