mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts
synced 2024-11-23 15:56:52 +00:00
Use namespaced classes
Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Ibe1138dab9ef7acfdab33c23590af90fefeb9f7c
This commit is contained in:
parent
23791622e0
commit
95de114452
|
@ -2,9 +2,10 @@
|
|||
|
||||
namespace MediaWiki\Extension\TextExtracts;
|
||||
|
||||
use ApiBase;
|
||||
use ApiQueryBase;
|
||||
use ApiUsageException;
|
||||
use MediaWiki\Api\ApiBase;
|
||||
use MediaWiki\Api\ApiQuery;
|
||||
use MediaWiki\Api\ApiQueryBase;
|
||||
use MediaWiki\Api\ApiUsageException;
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Config\ConfigFactory;
|
||||
use MediaWiki\Languages\LanguageConverterFactory;
|
||||
|
@ -12,9 +13,9 @@ use MediaWiki\Logger\LoggerFactory;
|
|||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Page\PageIdentity;
|
||||
use MediaWiki\Page\WikiPageFactory;
|
||||
use MediaWiki\Parser\ParserOptions;
|
||||
use MediaWiki\Title\TitleFormatter;
|
||||
use ParserOptions;
|
||||
use WANObjectCache;
|
||||
use Wikimedia\ObjectCache\WANObjectCache;
|
||||
use Wikimedia\ParamValidator\ParamValidator;
|
||||
use WikiPage;
|
||||
|
||||
|
@ -61,7 +62,7 @@ class ApiQueryExtracts extends ApiQueryBase {
|
|||
private $supportedContentModels = [ 'wikitext' ];
|
||||
|
||||
/**
|
||||
* @param \ApiQuery $query API query module object
|
||||
* @param ApiQuery $query API query module object
|
||||
* @param string $moduleName Name of this query module
|
||||
* @param ConfigFactory $configFactory
|
||||
* @param WANObjectCache $cache
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace MediaWiki\Extension\TextExtracts;
|
||||
|
||||
use ApiMain;
|
||||
use ApiResult;
|
||||
use Generator;
|
||||
use MediaWiki\Api\ApiMain;
|
||||
use MediaWiki\Api\ApiResult;
|
||||
use MediaWiki\Api\Hook\ApiOpenSearchSuggestHook;
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Config\ConfigFactory;
|
||||
|
|
|
@ -2,16 +2,22 @@
|
|||
|
||||
namespace MediaWiki\Extension\TextExtracts\Test;
|
||||
|
||||
use ILanguageConverter;
|
||||
use MediaWiki\Api\ApiBase;
|
||||
use MediaWiki\Api\ApiMain;
|
||||
use MediaWiki\Api\ApiQuery;
|
||||
use MediaWiki\Config\ConfigFactory;
|
||||
use MediaWiki\Config\HashConfig;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
use MediaWiki\Extension\TextExtracts\ApiQueryExtracts;
|
||||
use MediaWiki\Language\ILanguageConverter;
|
||||
use MediaWiki\Language\Language;
|
||||
use MediaWiki\Languages\LanguageConverterFactory;
|
||||
use MediaWiki\Message\Message;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWikiCoversValidator;
|
||||
use Wikimedia\LightweightObjectStore\ExpirationAwareness;
|
||||
use Wikimedia\ObjectCache\HashBagOStuff;
|
||||
use Wikimedia\ObjectCache\WANObjectCache;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
|
@ -33,7 +39,7 @@ class ApiQueryExtractsTest extends \MediaWikiIntegrationTestCase {
|
|||
->with( 'textextracts' )
|
||||
->willReturn( $config );
|
||||
|
||||
$cache = new \WANObjectCache( [ 'cache' => new \HashBagOStuff() ] );
|
||||
$cache = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
|
||||
|
||||
$context = $this->createMock( IContextSource::class );
|
||||
$context->method( 'getConfig' )
|
||||
|
@ -45,12 +51,12 @@ class ApiQueryExtractsTest extends \MediaWikiIntegrationTestCase {
|
|||
return $msg;
|
||||
} );
|
||||
|
||||
$main = $this->createMock( \ApiMain::class );
|
||||
$main = $this->createMock( ApiMain::class );
|
||||
$main->expects( $this->once() )
|
||||
->method( 'getContext' )
|
||||
->willReturn( $context );
|
||||
|
||||
$query = $this->createMock( \ApiQuery::class );
|
||||
$query = $this->createMock( ApiQuery::class );
|
||||
$query->expects( $this->once() )
|
||||
->method( 'getMain' )
|
||||
->willReturn( $main );
|
||||
|
@ -76,7 +82,7 @@ class ApiQueryExtractsTest extends \MediaWikiIntegrationTestCase {
|
|||
public function testMemCacheHelpers() {
|
||||
$title = $this->createMock( Title::class );
|
||||
$title->method( 'getPageLanguage' )
|
||||
->willReturn( $this->createMock( \Language::class ) );
|
||||
->willReturn( $this->createMock( Language::class ) );
|
||||
|
||||
$page = $this->createMock( \WikiPage::class );
|
||||
$page->method( 'getTitle' )
|
||||
|
@ -111,14 +117,14 @@ class ApiQueryExtractsTest extends \MediaWikiIntegrationTestCase {
|
|||
$params = $instance->getAllowedParams();
|
||||
$this->assertIsArray( $params );
|
||||
|
||||
$this->assertSame( 1, $params['chars'][\ApiBase::PARAM_MIN] );
|
||||
$this->assertSame( 1200, $params['chars'][\ApiBase::PARAM_MAX] );
|
||||
$this->assertSame( 1, $params['chars'][ApiBase::PARAM_MIN] );
|
||||
$this->assertSame( 1200, $params['chars'][ApiBase::PARAM_MAX] );
|
||||
|
||||
$this->assertSame( 20, $params['limit'][\ApiBase::PARAM_DFLT] );
|
||||
$this->assertSame( 'limit', $params['limit'][\ApiBase::PARAM_TYPE] );
|
||||
$this->assertSame( 1, $params['limit'][\ApiBase::PARAM_MIN] );
|
||||
$this->assertSame( 20, $params['limit'][\ApiBase::PARAM_MAX] );
|
||||
$this->assertSame( 20, $params['limit'][\ApiBase::PARAM_MAX2] );
|
||||
$this->assertSame( 20, $params['limit'][ApiBase::PARAM_DFLT] );
|
||||
$this->assertSame( 'limit', $params['limit'][ApiBase::PARAM_TYPE] );
|
||||
$this->assertSame( 1, $params['limit'][ApiBase::PARAM_MIN] );
|
||||
$this->assertSame( 20, $params['limit'][ApiBase::PARAM_MAX] );
|
||||
$this->assertSame( 20, $params['limit'][ApiBase::PARAM_MAX2] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue