use MediaWiki\Session\SessionManager;
class FauxRequestTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers FauxRequest::__construct
*/
*/
class MediaWikiVersionFetcherTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testReturnsResult() {
$versionFetcher = new MediaWikiVersionFetcher();
$this->assertInternalType( 'string', $versionFetcher->fetchVersion() );
*/
class SanitizerValidateEmailTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
private function checkEmail( $addr, $expected = true, $msg = '' ) {
if ( $msg == '' ) {
$msg = "Testing $addr";
*/
class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
private function getMockResultWrapper( $row = null, $numRows = 1 ) {
$resultWrapper = $this->getMockBuilder( 'ResultWrapper' )
->disableOriginalConstructor();
class WikiReferenceTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function provideGetDisplayName() {
return [
'http' => [ 'foo.bar', 'http://foo.bar' ],
*/
class XmlJsTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers XmlJsCode::__construct
* @dataProvider provideConstruction
*/
class ComposerVersionNormalizerTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @dataProvider nonStringProvider
*/
class EtcdConfigTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
private function createConfigMock( array $options = [] ) {
return $this->getMockBuilder( EtcdConfig::class )
->setConstructorArgs( [ $options + [
*/
class MWCallableUpdateTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testDoUpdate() {
$ran = 0;
$update = new MWCallableUpdate( function () use ( &$ran ) {
*/
class TransactionRoundDefiningUpdateTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testDoUpdate() {
$ran = 0;
$update = new TransactionRoundDefiningUpdate( function () use ( &$ran ) {
*/
class ExternalStoreFactoryTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testExternalStoreFactory_noStores() {
$factory = new ExternalStoreFactory( [] );
$this->assertFalse( $factory->getStoreObject( 'ForTesting' ) );
<?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' );
*/
class JobQueueMemoryTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @return JobQueueMemory
*/
*/
class ArrayUtilsTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
private $search;
/**
class DeferredStringifierTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers DeferredStringifier
* @dataProvider provideToString
<?php
class DnsSrvDiscovererTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers DnsSrvDiscoverer
* @dataProvider provideRecords
*/
abstract class GenericArrayObjectTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* Returns objects that can serve as elements in the concrete
* GenericArrayObject deriving class being tested.
* @group HashRing
*/
class HashRingTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers HashRing
*/
*/
class HtmlArmorTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public static function provideConstructor() {
return [
[ 'test' ],
* ...a dataprovider and test method.
*/
class IEUrlExtensionTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers IEUrlExtension::findIE6Extension
*/
*/
class IPTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers IP::isIPAddress
* @dataProvider provideInvalidIPs
class JavaScriptMinifierTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public static function provideCases() {
return [
*/
class MWMessagePackTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* Provides test cases for MWMessagePackTest::testMessagePack
*
* @group Cache
*/
class MapCacheLRUTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers MapCacheLRU::newFromArray()
* @covers MapCacheLRU::toArray()
*/
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.
class ObjectFactoryTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers ObjectFactory::getObjectFromSpec
*/
*/
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.
use Liuggio\StatsdClient\Sender\SenderInterface;
class SamplingStatsdClientTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @dataProvider samplingDataProvider
*/
class StringUtilsTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers StringUtils::isUtf8
* @dataProvider provideStringsForIsUtf8Check
class TimingTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers Timing::clearMarks
* @covers Timing::getEntries
*/
class XhprofDataTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers XhprofData::splitKey
* @dataProvider provideSplitKey
*/
class XhprofTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* Trying to enable Xhprof when it is already enabled causes an exception
* to be thrown.
* @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
* @covers MimeAnalyzer
*/
class MimeAnalyzerTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/** @var MimeAnalyzer */
private $mimeAnalyzer;
*/
class CachedBagOStuffTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers CachedBagOStuff::__construct
* @covers CachedBagOStuff::doGet
*/
class HashBagOStuffTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @covers HashBagOStuff::__construct
*/
* @covers WANObjectCache::setInterimValue
*/
class WANObjectCacheTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/** @var TimeAdjustableWANObjectCache */
private $cache;
/** @var BagOStuff */
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' );
* @covers Wikimedia\Rdbms\DatabaseDomain
*/
class DatabaseDomainTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public static function provideConstruct() {
return [
'All strings' =>
}
class DatabaseMysqlBaseTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @dataProvider provideDiapers
* @covers Wikimedia\Rdbms\DatabaseMysqlBase::addIdentifierQuotes
* with creating SQL text.
*/
class DatabaseSQLTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/** @var DatabaseTestHelper */
private $database;
class DatabaseTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected function setUp() {
$this->db = new DatabaseTestHelper( __CLASS__ . '::' . $this->getName() );
}
*/
class XMPTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected function setUp() {
parent::setUp();
# Requires libxml to do XMP parsing
*/
class XMPValidateTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @dataProvider provideDates
* @covers XMPValidate::validateDate
* @group BagOStuff
*/
class RedisBagOStuffTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/** @var RedisBagOStuff */
private $cache;
* @todo covers tags
*/
class ParserIntegrationTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/** @var array */
private $ptTest;
* @covers VersionChecker
*/
class VersionCheckerTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @dataProvider provideCheck
*/
*/
class DerivativeResourceLoaderContextTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected static function getContext() {
$request = new FauxRequest( [
'lang' => 'zh',
*/
class MessageBlobStoreTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected function setUp() {
parent::setUp();
// MediaWiki tests defaults $wgMainWANCache to CACHE_NONE.
*/
class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected static function expandVariables( $text ) {
return strtr( $text, [
'{blankVer}' => ResourceLoaderTestCase::BLANK_VERSION
* @covers ResourceLoaderContext
*/
class ResourceLoaderContextTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
protected static function getResourceLoader() {
return new EmptyResourceLoader( new HashConfig( [
'ResourceLoaderDebug' => false,
*/
class ResourceLoaderSkinModuleTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
// @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
public static function provideGetStyles() {
return [
*/
class ServiceContainerTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
private function newServiceContainer( $extraArgs = [] ) {
return new ServiceContainer( $extraArgs );
}
* @group Shell
*/
class CommandFactoryTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
/**
* @covers MediaWiki\Shell\CommandFactory::create
*/
* @group Shell
*/
class CommandTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
private function requirePosix() {
if ( wfIsWindows() ) {
$this->markTestSkipped( 'This test requires a POSIX environment.' );
use Wikimedia\TestingAccessWrapper;
class FirejailCommandTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public function provideBuildFinalCommand() {
global $IP;
// @codingStandardsIgnoreStart
* @group Shell
*/
class ShellTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public function testIsDisabled() {
$this->assertInternalType( 'bool', Shell::isDisabled() ); // sanity
}
*/
class FileBasedSiteLookupTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected function setUp() {
$this->cacheFile = $this->getCacheFile();
}
*/
class MediaWikiPageNameNormalizerTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @dataProvider normalizePageTitleProvider
*/
*/
class SiteExporterTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testConstructor_InvalidArgument() {
$this->setExpectedException( 'InvalidArgumentException' );
*/
class SiteImporterTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
private function newSiteImporter( array $expectedSites, $errorCount ) {
$store = $this->getMockBuilder( 'SiteStore' )->getMock();
*/
class SitesCacheFileBuilderTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected function setUp() {
$this->cacheFile = $this->getCacheFile();
}
*/
class AvroValidatorTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public function setUp() {
if ( !class_exists( 'AvroSchema' ) ) {
$this->markTestSkipped( 'Avro is required to run the AvroValidatorTest' );
*/
class ClassCollectorTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public static function provideCases() {
return [
[
*/
class FileContentsHasherTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function provideSingleFile() {
return array_map( function ( $file ) {
return [ $file, file_get_contents( $file ) ];
class MWCryptHashTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testHashLength() {
if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
$this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
<?php
class MWRestrictionsTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected static $restrictionsForChecks;
public static function setUpBeforeClass() {
class UIDGeneratorTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
protected function tearDown() {
// Bug: 44850
UIDGenerator::unitTestTearDown();
* 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;
*/
class WatchedItemQueryServiceUnitTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @return PHPUnit_Framework_MockObject_MockObject|Database
*/
*/
class LanguageCodeTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
public function testConstructor() {
$instance = new LanguageCode();
* @covers Benchmarker
*/
class BenchmarkerTest extends PHPUnit_Framework_TestCase {
+
+ use MediaWikiCoversValidator;
+
public function testBenchSimple() {
$bench = $this->getMockBuilder( Benchmarker::class )
->setMethods( [ 'execute', 'output' ] )
*/
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.
*/
class ExtensionJsonValidationTest extends PHPUnit_Framework_TestCase {
+ use MediaWikiCoversValidator;
+
/**
* @var ExtensionJsonValidator
*/