Make LocalisationCache a service
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiIntegrationTestCase.php
index aa43e5d..af5d88b 100644 (file)
@@ -23,8 +23,9 @@ use Wikimedia\TestingAccessWrapper;
 abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
 
        use MediaWikiCoversValidator;
-       use PHPUnit4And6Compat;
        use MediaWikiGroupValidator;
+       use MediaWikiTestCaseTrait;
+       use PHPUnit4And6Compat;
 
        /**
         * The original service locator. This is overridden during setUp().
@@ -253,7 +254,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
                if ( !$page->exists() ) {
                        $user = self::getTestSysop()->getUser();
                        $page->doEditContent(
-                               new WikitextContent( 'UTContent' ),
+                               ContentHandler::makeContent( 'UTContent', $title ),
                                'UTPageSummary',
                                EDIT_NEW | EDIT_SUPPRESS_RC,
                                false,
@@ -403,6 +404,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
 
                $wgRequest = new FauxRequest();
                MediaWiki\Session\SessionManager::resetCache();
+               Language::clearCaches();
        }
 
        public function run( PHPUnit_Framework_TestResult $result = null ) {
@@ -2510,20 +2512,6 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
                        'comment' => $comment,
                ] );
        }
-
-       /**
-        * Returns a PHPUnit constraint that matches anything other than a fixed set of values. This can
-        * be used to whitelist values, e.g.
-        *   $mock->expects( $this->never() )->method( $this->anythingBut( 'foo', 'bar' ) );
-        * which will throw if any unexpected method is called.
-        *
-        * @param mixed ...$values Values that are not matched
-        */
-       protected function anythingBut( ...$values ) {
-               return $this->logicalNot( $this->logicalOr(
-                       ...array_map( [ $this, 'matches' ], $values )
-               ) );
-       }
 }
 
 class_alias( 'MediaWikiIntegrationTestCase', 'MediaWikiTestCase' );