Add support of assertEmpty (used since r81596) for phpunit < 3.5.0
authorPlatonides <platonides@users.mediawiki.org>
Thu, 10 Feb 2011 09:51:31 +0000 (09:51 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Thu, 10 Feb 2011 09:51:31 +0000 (09:51 +0000)
tests/phpunit/MediaWikiTestCase.php

index da02fe7..5caac22 100644 (file)
@@ -170,6 +170,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        'assertInternalType' => 'assertType',
                        'assertNotInternalType' => 'assertNotType',
                        'assertInstanceOf' => 'assertType',
+                       'assertEmpty' => 'assertEmpty2',
                );
 
                if ( method_exists( $this->suite, $func ) ) {
@@ -181,6 +182,10 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                                . get_class( $this ) );
                }
        }
+
+       static private assertEmpty2( $value, $msg ) {
+               return $this->assertTrue( $value == '', $msg );
+       }
        
        static private function unprefixTable( $tableName ) {
                global $wgDBprefix;