Use MediaWikiCoversValidator for tests that don't use MediaWikiTestCase
authorKunal Mehta <legoktm@member.fsf.org>
Fri, 29 Dec 2017 23:22:37 +0000 (15:22 -0800)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 1 Jan 2018 08:28:02 +0000 (08:28 +0000)
Change-Id: I8c4de7e9c72c9969088666007b54c6fd23f6cc13

74 files changed:
tests/phpunit/includes/FauxRequestTest.php
tests/phpunit/includes/MediaWikiVersionFetcherTest.php
tests/phpunit/includes/SanitizerValidateEmailTest.php
tests/phpunit/includes/TitleArrayFromResultTest.php
tests/phpunit/includes/WikiReferenceTest.php
tests/phpunit/includes/XmlJsTest.php
tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php
tests/phpunit/includes/config/EtcdConfigTest.php
tests/phpunit/includes/deferred/MWCallableUpdateTest.php
tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php
tests/phpunit/includes/externalstore/ExternalStoreFactoryTest.php
tests/phpunit/includes/htmlform/HTMLRestrictionsFieldTest.php
tests/phpunit/includes/jobqueue/JobQueueMemoryTest.php
tests/phpunit/includes/libs/ArrayUtilsTest.php
tests/phpunit/includes/libs/DeferredStringifierTest.php
tests/phpunit/includes/libs/DnsSrvDiscovererTest.php
tests/phpunit/includes/libs/GenericArrayObjectTest.php
tests/phpunit/includes/libs/HashRingTest.php
tests/phpunit/includes/libs/HtmlArmorTest.php
tests/phpunit/includes/libs/IEUrlExtensionTest.php
tests/phpunit/includes/libs/IPTest.php
tests/phpunit/includes/libs/JavaScriptMinifierTest.php
tests/phpunit/includes/libs/MWMessagePackTest.php
tests/phpunit/includes/libs/MapCacheLRUTest.php
tests/phpunit/includes/libs/MemoizedCallableTest.php
tests/phpunit/includes/libs/ObjectFactoryTest.php
tests/phpunit/includes/libs/ProcessCacheLRUTest.php
tests/phpunit/includes/libs/SamplingStatsdClientTest.php
tests/phpunit/includes/libs/StringUtilsTest.php
tests/phpunit/includes/libs/TimingTest.php
tests/phpunit/includes/libs/XhprofDataTest.php
tests/phpunit/includes/libs/XhprofTest.php
tests/phpunit/includes/libs/XmlTypeCheckTest.php
tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
tests/phpunit/includes/libs/objectcache/CachedBagOStuffTest.php
tests/phpunit/includes/libs/objectcache/HashBagOStuffTest.php
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
tests/phpunit/includes/libs/rdbms/TransactionProfilerTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseDomainTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseMysqlBaseTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php
tests/phpunit/includes/libs/xmp/XMPTest.php
tests/phpunit/includes/libs/xmp/XMPValidateTest.php
tests/phpunit/includes/objectcache/RedisBagOStuffTest.php
tests/phpunit/includes/parser/ParserIntegrationTest.php
tests/phpunit/includes/registration/VersionCheckerTest.php
tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php
tests/phpunit/includes/resourceloader/MessageBlobStoreTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php
tests/phpunit/includes/services/ServiceContainerTest.php
tests/phpunit/includes/shell/CommandFactoryTest.php
tests/phpunit/includes/shell/CommandTest.php
tests/phpunit/includes/shell/FirejailCommandTest.php
tests/phpunit/includes/shell/ShellTest.php
tests/phpunit/includes/site/FileBasedSiteLookupTest.php
tests/phpunit/includes/site/MediaWikiPageNameNormalizerTest.php
tests/phpunit/includes/site/SiteExporterTest.php
tests/phpunit/includes/site/SiteImporterTest.php
tests/phpunit/includes/site/SitesCacheFileBuilderTest.php
tests/phpunit/includes/utils/AvroValidatorTest.php
tests/phpunit/includes/utils/ClassCollectorTest.php
tests/phpunit/includes/utils/FileContentsHasherTest.php
tests/phpunit/includes/utils/MWCryptHashTest.php
tests/phpunit/includes/utils/MWRestrictionsTest.php
tests/phpunit/includes/utils/UIDGeneratorTest.php
tests/phpunit/includes/utils/ZipDirectoryReaderTest.php
tests/phpunit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php
tests/phpunit/languages/LanguageCodeTest.php
tests/phpunit/maintenance/BenchmarkerTest.php
tests/phpunit/structure/AvailableRightsTest.php
tests/phpunit/structure/ExtensionJsonValidationTest.php

index 9fe694d..e39dcdb 100644 (file)
@@ -3,6 +3,9 @@
 use MediaWiki\Session\SessionManager;
 
 class FauxRequestTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @covers FauxRequest::__construct
         */
index fa59ef2..6aa9849 100644 (file)
@@ -12,6 +12,8 @@
  */
 class MediaWikiVersionFetcherTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function testReturnsResult() {
                $versionFetcher = new MediaWikiVersionFetcher();
                $this->assertInternalType( 'string', $versionFetcher->fetchVersion() );
index 2448513..c7e15ea 100644 (file)
@@ -7,6 +7,8 @@
  */
 class SanitizerValidateEmailTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        private function checkEmail( $addr, $expected = true, $msg = '' ) {
                if ( $msg == '' ) {
                        $msg = "Testing $addr";
index 7c2973f..8882214 100644 (file)
@@ -6,6 +6,8 @@
  */
 class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        private function getMockResultWrapper( $row = null, $numRows = 1 ) {
                $resultWrapper = $this->getMockBuilder( 'ResultWrapper' )
                        ->disableOriginalConstructor();
index 724dd60..227dd87 100644 (file)
@@ -6,6 +6,8 @@
 
 class WikiReferenceTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function provideGetDisplayName() {
                return [
                        'http' => [ 'foo.bar', 'http://foo.bar' ],
index c2bc73e..dec7bf3 100644 (file)
@@ -5,6 +5,8 @@
  */
 class XmlJsTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers XmlJsCode::__construct
         * @dataProvider provideConstruction
index 8a2ebaf..a4cc446 100644 (file)
@@ -9,6 +9,8 @@
  */
 class ComposerVersionNormalizerTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @dataProvider nonStringProvider
         */
index 3e70a07..7a4d9d9 100644 (file)
@@ -4,6 +4,8 @@ use Wikimedia\TestingAccessWrapper;
 
 class EtcdConfigTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        private function createConfigMock( array $options = [] ) {
                return $this->getMockBuilder( EtcdConfig::class )
                        ->setConstructorArgs( [ $options + [
index 6995bf8..088ab4f 100644 (file)
@@ -5,6 +5,8 @@
  */
 class MWCallableUpdateTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function testDoUpdate() {
                $ran = 0;
                $update = new MWCallableUpdate( function () use ( &$ran ) {
index e6ad072..1261c24 100644 (file)
@@ -5,6 +5,8 @@
  */
 class TransactionRoundDefiningUpdateTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function testDoUpdate() {
                $ran = 0;
                $update = new TransactionRoundDefiningUpdate( function () use ( &$ran ) {
index a0bac63..d43e04a 100644 (file)
@@ -5,6 +5,8 @@
  */
 class ExternalStoreFactoryTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function testExternalStoreFactory_noStores() {
                $factory = new ExternalStoreFactory( [] );
                $this->assertFalse( $factory->getStoreObject( 'ForTesting' ) );
index 9ec4f97..13c92e3 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 
 class HTMLRestrictionsFieldTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        public function testConstruct() {
                $field = new HTMLRestrictionsField( [ 'fieldname' => 'restrictions' ] );
                $this->assertNotEmpty( $field->getLabel(), 'has a default label' );
index fe7c506..edba75c 100644 (file)
@@ -10,6 +10,8 @@
  */
 class JobQueueMemoryTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @return JobQueueMemory
         */
index 21472d5..76b4ee1 100644 (file)
@@ -6,6 +6,9 @@
  */
 
 class ArrayUtilsTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        private $search;
 
        /**
index cba2939..c3a1285 100644 (file)
@@ -2,6 +2,8 @@
 
 class DeferredStringifierTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers DeferredStringifier
         * @dataProvider provideToString
index cfc2d91..bc20c4c 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 
 class DnsSrvDiscovererTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @covers DnsSrvDiscoverer
         * @dataProvider provideRecords
index 12c5787..3e8aaeb 100644 (file)
@@ -28,6 +28,8 @@
  */
 abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * Returns objects that can serve as elements in the concrete
         * GenericArrayObject deriving class being tested.
index 0822a8a..040bebf 100644 (file)
@@ -4,6 +4,9 @@
  * @group HashRing
  */
 class HashRingTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @covers HashRing
         */
index 0e9469a..eb601e7 100644 (file)
@@ -5,6 +5,8 @@
  */
 class HtmlArmorTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public static function provideConstructor() {
                return [
                        [ 'test' ],
index 57668e5..8192f01 100644 (file)
@@ -6,6 +6,9 @@
  *    ...a dataprovider and test method.
  */
 class IEUrlExtensionTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @covers IEUrlExtension::findIE6Extension
         */
index e47c4ba..84e4706 100644 (file)
@@ -10,6 +10,9 @@
  */
 
 class IPTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @covers IP::isIPAddress
         * @dataProvider provideInvalidIPs
index 12b2c04..5061e27 100644 (file)
@@ -2,6 +2,8 @@
 
 class JavaScriptMinifierTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public static function provideCases() {
                return [
 
index 88dc67a..57c9831 100644 (file)
@@ -5,6 +5,8 @@
  */
 class MWMessagePackTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * Provides test cases for MWMessagePackTest::testMessagePack
         *
index 60a5057..363b081 100644 (file)
@@ -3,6 +3,9 @@
  * @group Cache
  */
 class MapCacheLRUTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @covers MapCacheLRU::newFromArray()
         * @covers MapCacheLRU::toArray()
index d99c587..ba8af93 100644 (file)
@@ -26,6 +26,8 @@ class ArrayBackedMemoizedCallable extends MemoizedCallable {
  */
 class MemoizedCallableTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * The memoized callable should relate inputs to outputs in the same
         * way as the original underlying callable.
index 35a7b60..03814da 100644 (file)
@@ -20,6 +20,8 @@
 
 class ObjectFactoryTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers ObjectFactory::getObjectFromSpec
         */
index 9c189d1..e027d5b 100644 (file)
@@ -11,6 +11,8 @@
  */
 class ProcessCacheLRUTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * Helper to verify emptiness of a cache object.
         * Compare against an array so we get the cache content difference.
index c5bc03e..cf18aaf 100644 (file)
@@ -4,6 +4,9 @@ use Liuggio\StatsdClient\Entity\StatsdData;
 use Liuggio\StatsdClient\Sender\SenderInterface;
 
 class SamplingStatsdClientTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @dataProvider samplingDataProvider
         */
index 8075944..3e5ccac 100644 (file)
@@ -2,6 +2,8 @@
 
 class StringUtilsTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers StringUtils::isUtf8
         * @dataProvider provideStringsForIsUtf8Check
index 4d71944..7e166f8 100644 (file)
@@ -21,6 +21,8 @@
 
 class TimingTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers Timing::clearMarks
         * @covers Timing::getEntries
index 35e9005..d226227 100644 (file)
@@ -26,6 +26,8 @@
  */
 class XhprofDataTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers XhprofData::splitKey
         * @dataProvider provideSplitKey
index 6748115..c9123b8 100644 (file)
@@ -19,6 +19,9 @@
  */
 
 class XhprofTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * Trying to enable Xhprof when it is already enabled causes an exception
         * to be thrown.
index 5c5eeaa..97aeec3 100644 (file)
@@ -6,6 +6,9 @@
  * @covers XMLTypeCheck
  */
 class XmlTypeCheckTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        const WELL_FORMED_XML = "<root><child /></root>";
        const MAL_FORMED_XML = "<root><child /></error>";
        // @codingStandardsIgnoreStart Generic.Files.LineLength
index 742eb95..4743710 100644 (file)
@@ -4,6 +4,9 @@
  * @covers MimeAnalyzer
  */
 class MimeAnalyzerTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /** @var MimeAnalyzer */
        private $mimeAnalyzer;
 
index 8b9abbc..d71b16c 100644 (file)
@@ -7,6 +7,8 @@ use Wikimedia\TestingAccessWrapper;
  */
 class CachedBagOStuffTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers CachedBagOStuff::__construct
         * @covers CachedBagOStuff::doGet
index 53d27c0..9eb3409 100644 (file)
@@ -7,6 +7,8 @@ use Wikimedia\TestingAccessWrapper;
  */
 class HashBagOStuffTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @covers HashBagOStuff::__construct
         */
index e534f92..7053fc1 100644 (file)
@@ -17,6 +17,9 @@ use Wikimedia\TestingAccessWrapper;
  * @covers WANObjectCache::setInterimValue
  */
 class WANObjectCacheTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /** @var TimeAdjustableWANObjectCache */
        private $cache;
        /** @var BagOStuff */
index b6ea426..a0de408 100644 (file)
@@ -4,6 +4,9 @@ use Wikimedia\Rdbms\TransactionProfiler;
 use Psr\Log\LoggerInterface;
 
 class TransactionProfilerTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        public function testAffected() {
                $logger = $this->getMockBuilder( LoggerInterface::class )->getMock();
                $logger->expects( $this->exactly( 3 ) )->method( 'info' );
index a8dbdd3..4e5f735 100644 (file)
@@ -6,6 +6,9 @@ use Wikimedia\Rdbms\DatabaseDomain;
  * @covers Wikimedia\Rdbms\DatabaseDomain
  */
 class DatabaseDomainTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        public static function provideConstruct() {
                return [
                        'All strings' =>
index 461ef09..a9f1880 100644 (file)
@@ -106,6 +106,9 @@ class FakeDatabaseMysqlBase extends DatabaseMysqlBase {
 }
 
 class DatabaseMysqlBaseTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @dataProvider provideDiapers
         * @covers Wikimedia\Rdbms\DatabaseMysqlBase::addIdentifierQuotes
index 7b84117..10dbcce 100644 (file)
@@ -7,6 +7,9 @@ use Wikimedia\Rdbms\LikeMatch;
  * with creating SQL text.
  */
 class DatabaseSQLTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /** @var DatabaseTestHelper */
        private $database;
 
index 7933f19..4a0a7e7 100644 (file)
@@ -7,6 +7,8 @@ use Wikimedia\TestingAccessWrapper;
 
 class DatabaseTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected function setUp() {
                $this->db = new DatabaseTestHelper( __CLASS__ . '::' . $this->getName() );
        }
index 514e6cd..7becad2 100644 (file)
@@ -6,6 +6,8 @@
  */
 class XMPTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected function setUp() {
                parent::setUp();
                # Requires libxml to do XMP parsing
index 7f7ea93..0785920 100644 (file)
@@ -7,6 +7,8 @@ use Psr\Log\NullLogger;
  */
 class XMPValidateTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @dataProvider provideDates
         * @covers XMPValidate::validateDate
index 34a72ce..ea58e4a 100644 (file)
@@ -6,6 +6,9 @@ use Wikimedia\TestingAccessWrapper;
  * @group BagOStuff
  */
 class RedisBagOStuffTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /** @var RedisBagOStuff */
        private $cache;
 
index c920982..8d17d21 100644 (file)
@@ -15,6 +15,9 @@ use Wikimedia\ScopedCallback;
  * @todo covers tags
  */
 class ParserIntegrationTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /** @var array */
        private $ptTest;
 
index 9ee5881..15d0c2b 100644 (file)
@@ -4,6 +4,9 @@
  * @covers VersionChecker
  */
 class VersionCheckerTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @dataProvider provideCheck
         */
index 0be04ef..db1fb64 100644 (file)
@@ -6,6 +6,8 @@
  */
 class DerivativeResourceLoaderContextTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected static function getContext() {
                $request = new FauxRequest( [
                                'lang' => 'zh',
index 1f2c617..7521e88 100644 (file)
@@ -8,6 +8,8 @@ use Wikimedia\TestingAccessWrapper;
  */
 class MessageBlobStoreTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected function setUp() {
                parent::setUp();
                // MediaWiki tests defaults $wgMainWANCache to CACHE_NONE.
index f75d67d..49aeb30 100644 (file)
@@ -7,6 +7,8 @@ use Wikimedia\TestingAccessWrapper;
  */
 class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected static function expandVariables( $text ) {
                return strtr( $text, [
                        '{blankVer}' => ResourceLoaderTestCase::BLANK_VERSION
index b658efb..f848556 100644 (file)
@@ -9,6 +9,9 @@
  * @covers ResourceLoaderContext
  */
 class ResourceLoaderContextTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        protected static function getResourceLoader() {
                return new EmptyResourceLoader( new HashConfig( [
                        'ResourceLoaderDebug' => false,
index be17a69..6b0095c 100644 (file)
@@ -5,6 +5,8 @@
  */
 class ResourceLoaderSkinModuleTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
        public static function provideGetStyles() {
                return [
index b68ee48..f4f5650 100644 (file)
@@ -8,6 +8,8 @@ use MediaWiki\Services\ServiceContainer;
  */
 class ServiceContainerTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        private function newServiceContainer( $extraArgs = [] ) {
                return new ServiceContainer( $extraArgs );
        }
index bf0f65b..cb2669f 100644 (file)
@@ -10,6 +10,9 @@ use Wikimedia\TestingAccessWrapper;
  * @group Shell
  */
 class CommandFactoryTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        /**
         * @covers MediaWiki\Shell\CommandFactory::create
         */
index 385dd50..2bafa03 100644 (file)
@@ -8,6 +8,9 @@ use Wikimedia\TestingAccessWrapper;
  * @group Shell
  */
 class CommandTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        private function requirePosix() {
                if ( wfIsWindows() ) {
                        $this->markTestSkipped( 'This test requires a POSIX environment.' );
index 7d6d7f8..02e6e79 100644 (file)
@@ -24,6 +24,9 @@ use MediaWiki\Shell\Shell;
 use Wikimedia\TestingAccessWrapper;
 
 class FirejailCommandTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        public function provideBuildFinalCommand() {
                global $IP;
                // @codingStandardsIgnoreStart
index 2f68dbd..986a665 100644 (file)
@@ -7,6 +7,9 @@ use MediaWiki\Shell\Shell;
  * @group Shell
  */
 class ShellTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        public function testIsDisabled() {
                $this->assertInternalType( 'bool', Shell::isDisabled() ); // sanity
        }
index 7984795..ed6fbfe 100644 (file)
@@ -29,6 +29,8 @@
  */
 class FileBasedSiteLookupTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected function setUp() {
                $this->cacheFile = $this->getCacheFile();
        }
index 64cdbaa..d230550 100644 (file)
@@ -29,6 +29,8 @@ use MediaWiki\Site\MediaWikiPageNameNormalizer;
  */
 class MediaWikiPageNameNormalizerTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @dataProvider normalizePageTitleProvider
         */
index c0d8c00..09cdea7 100644 (file)
@@ -31,6 +31,8 @@
  */
 class SiteExporterTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function testConstructor_InvalidArgument() {
                $this->setExpectedException( 'InvalidArgumentException' );
 
index ea49429..8a43bf8 100644 (file)
@@ -31,6 +31,8 @@
  */
 class SiteImporterTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        private function newSiteImporter( array $expectedSites, $errorCount ) {
                $store = $this->getMockBuilder( 'SiteStore' )->getMock();
 
index af94a9d..6514beb 100644 (file)
@@ -29,6 +29,8 @@
  */
 class SitesCacheFileBuilderTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected function setUp() {
                $this->cacheFile = $this->getCacheFile();
        }
index 7559e22..902f6d9 100644 (file)
@@ -10,6 +10,9 @@
  */
 
 class AvroValidatorTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        public function setUp() {
                if ( !class_exists( 'AvroSchema' ) ) {
                        $this->markTestSkipped( 'Avro is required to run the AvroValidatorTest' );
index e8a228e..8e07b5e 100644 (file)
@@ -5,6 +5,8 @@
  */
 class ClassCollectorTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public static function provideCases() {
                return [
                        [
index 0ee4c13..b3885bd 100644 (file)
@@ -5,6 +5,8 @@
  */
 class FileContentsHasherTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function provideSingleFile() {
                return array_map( function ( $file ) {
                        return [ $file, file_get_contents( $file ) ];
index 905d14c..13151ab 100644 (file)
@@ -6,6 +6,8 @@
 
 class MWCryptHashTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function testHashLength() {
                if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
                        $this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
index f2ea489..4c05326 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 class MWRestrictionsTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected static $restrictionsForChecks;
 
        public static function setUpBeforeClass() {
index 8b54b72..230c935 100644 (file)
@@ -2,6 +2,8 @@
 
 class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        protected function tearDown() {
                // Bug: 44850
                UIDGenerator::unitTestTearDown();
index 7e74d96..09a0676 100644 (file)
@@ -5,6 +5,9 @@
  * NOTE: this test is more like an integration test than a unit test
  */
 class ZipDirectoryReaderTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        protected $zipDir;
        protected $entries;
 
index 62ba5f6..ef2486d 100644 (file)
@@ -8,6 +8,8 @@ use Wikimedia\TestingAccessWrapper;
  */
 class WatchedItemQueryServiceUnitTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @return PHPUnit_Framework_MockObject_MockObject|Database
         */
index 950d2df..d36f38b 100644 (file)
@@ -10,6 +10,8 @@
  */
 class LanguageCodeTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        public function testConstructor() {
                $instance = new LanguageCode();
 
index 69f98bd..ec570e2 100644 (file)
@@ -6,6 +6,9 @@ use Wikimedia\TestingAccessWrapper;
  * @covers Benchmarker
  */
 class BenchmarkerTest extends PHPUnit_Framework_TestCase {
+
+       use MediaWikiCoversValidator;
+
        public function testBenchSimple() {
                $bench = $this->getMockBuilder( Benchmarker::class )
                        ->setMethods( [ 'execute', 'output' ] )
index 16a9a24..4ab0c2c 100644 (file)
@@ -8,6 +8,8 @@
  */
 class AvailableRightsTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * Returns all rights that should be in $wgAvailableRights + all rights
         * registered via the 'UserGetAllRights' hook + all "core" rights.
index b19376d..0cf4659 100644 (file)
@@ -22,6 +22,8 @@
  */
 class ExtensionJsonValidationTest extends PHPUnit_Framework_TestCase {
 
+       use MediaWikiCoversValidator;
+
        /**
         * @var ExtensionJsonValidator
         */