News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mike Purcell's Blog:
PHPUnit - Upgrade - Convert assertType to assertInternalType
May 21, 2012 @ 09:56:59

In this quick post to his blog, Mike Purcell mentions the deprecation of the "assertType" assertion and includes some code you can add to correct the issue in your tests.

We recently upgraded phpunit from a very old version to the current 3.6.x version (at time of writing). During the upgrade I noticed that assertType is no longer supported in many of our tests which were testing if something was a string, an array, or an object. So I had to write a quick script to update assertType to assertInternalType and figured I would post it for others if they needed to do the same.

The code goes into each of your tests (recursively) and finds the places where the "assertType" assertion is used and replaces it with its newer cousin "assertIntrnalType".

0 comments voice your opinion now!
phpunit unittest asserttype assertinternaltype string replace


blog comments powered by Disqus

Similar Posts

Kevin Schroeder's Blog: ZendCon 2010 Podcast - Unit Testing in Zend Framework 1.8

Sebastian Bergmann's Blog: The Cost of Test Isolation (and other PHPUnit Features)

Matthew Weir O'Phinney's Blog: Getting XDebug working with PHPUnit for code coverage reports

Mike\'s Blog: Time to say Good Bye

Sebastian Bergmann\'s Blog: Fluent Interface in PHPUnit 3.0


Community Events











Don't see your event here?
Let us know!


code package overview install composer opinion podcast example security hhvm application symfony2 hack component introduction language framework release facebook unittest

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework