Merge "Fix "UTPage" creation in tests"
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiTestCase.php
index 723f120..1c9b7fb 100644 (file)
@@ -157,7 +157,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         *
         * @since 1.20
         *
-        * @return string absolute name of the temporary file
+        * @return string Absolute name of the temporary file
         */
        protected function getNewTempFile() {
                $fileName = tempnam( wfTempDir(), 'MW_PHPUnit_' . get_class( $this ) . '_' );
@@ -353,7 +353,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                                }
                                        // NOTE; some things such as Closures are not serializable
                                        // in this case just set the value!
-                               catch( Exception $e ) {
+                               catch ( Exception $e ) {
                                        $this->mwGlobals[$globalKey] = $GLOBALS[$globalKey];
                                }
                        }
@@ -467,7 +467,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
                //Make 1 page with 1 revision
                $page = WikiPage::factory( Title::newFromText( 'UTPage' ) );
-               if ( !$page->getId() == 0 ) {
+               if ( $page->getId() == 0 ) {
                        $page->doEditContent(
                                new WikitextContent( 'UTContent' ),
                                'UTPageSummary',
@@ -512,7 +512,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * even if using different parameters.
         *
         * @param DatabaseBase $db The database connection
-        * @param String $prefix The prefix to use for the new table set (aka schema).
+        * @param string $prefix The prefix to use for the new table set (aka schema).
         *
         * @throws MWException if the database table prefix is already $prefix
         */
@@ -586,9 +586,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         */
        public function __call( $func, $args ) {
                static $compatibility = array(
-                       'assertInternalType' => 'assertType', // assertInternalType was added in phpunit 3.5.0
-                       'assertNotInternalType' => 'assertNotType', // assertNotInternalType was added in phpunit 3.5.0
-                       'assertInstanceOf' => 'assertType', // assertInstanceOf was added in phpunit 3.5.0
                        'assertEmpty' => 'assertEmpty2', // assertEmpty was added in phpunit 3.7.32
                );
 
@@ -602,6 +599,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * Used as a compatibility method for phpunit < 3.7.32
+        * @param string $value
+        * @param string $msg
         */
        private function assertEmpty2( $value, $msg ) {
                return $this->assertTrue( $value == '', $msg );
@@ -663,6 +662,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * @since 1.18
+        * @param string $offset
+        * @return mixed
         */
        public function getCliArg( $offset ) {
                if ( isset( MediaWikiPHPUnitCommand::$additionalOptions[$offset] ) ) {
@@ -672,6 +673,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * @since 1.18
+        * @param string $offset
+        * @param mixed $value
         */
        public function setCliArg( $offset, $value ) {
                MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value;
@@ -683,7 +686,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @since 1.19
         *
         * @param string $function
-        * @return null
         */
        public function hideDeprecated( $function ) {
                wfSuppressWarnings();
@@ -1010,6 +1012,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * test whenever it is not loaded.
         *
         * @since 1.21
+        * @param string $extName
+        * @return bool
         */
        protected function checkPHPExtension( $extName ) {
                $loaded = extension_loaded( $extName );