X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FMediaWikiTestCase.php;h=53b944d6a4c37c00479ff948ff251fdf976e61af;hb=48d5e5b3c910b50b980a8902511b1c18f2233906;hp=3742a54618b1e0c1376dc7de909936968508fb3f;hpb=43b7373b48e210ca38cdc46162f5bfb0e812b277;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 3742a54618..53b944d6a4 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -4,7 +4,6 @@ * @since 1.18 */ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { - /** * $called tracks whether the setUp and tearDown method has been called. * class extending MediaWikiTestCase usually override setUp and tearDown @@ -157,7 +156,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 ) . '_' ); @@ -254,7 +253,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $oldHex = strtoupper( dechex( $this->phpErrorLevel ) ); $newHex = strtoupper( dechex( $phpErrorLevel ) ); - $message = "PHP error_reporting setting was left dirty: was 0x$oldHex before test, 0x$newHex after test!"; + $message = "PHP error_reporting setting was left dirty: " + . "was 0x$oldHex before test, 0x$newHex after test!"; $this->fail( $message ); } @@ -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 */ @@ -599,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 ); @@ -660,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] ) ) { @@ -669,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; @@ -680,7 +686,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @since 1.19 * * @param string $function - * @return null */ public function hideDeprecated( $function ) { wfSuppressWarnings(); @@ -767,7 +772,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * @param bool $ordered If the order of the values should match * @param bool $named If the keys should match */ - protected function assertArrayEquals( array $expected, array $actual, $ordered = false, $named = false ) { + protected function assertArrayEquals( array $expected, array $actual, + $ordered = false, $named = false + ) { if ( !$ordered ) { $this->objectAssociativeSort( $expected ); $this->objectAssociativeSort( $actual ); @@ -1007,6 +1014,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 ); @@ -1098,5 +1107,4 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $this->assertEmpty( $errors, implode( "\n", $errors ) ); } - }