Add sslCAFile option to DatabaseMysqli
[mediawiki.git] / tests / phpunit / includes / specials / SpecialShortpagesTest.php
bloba5fb50e062cd6b4f028a58f8e87f24cb5a989f3f
1 <?php
3 /**
4 * Test class for SpecialShortpages class
6 * @since 1.30
8 * @licence GNU GPL v2+
9 */
10 class SpecialShortpagesTest extends MediaWikiTestCase {
12 /**
13 * @dataProvider provideGetQueryInfoRespectsContentNs
14 * @covers ShortPagesPage::getQueryInfo()
16 public function testGetQueryInfoRespectsContentNS( $contentNS, $blacklistNS, $expectedNS ) {
17 $this->setMwGlobals( [
18 'wgShortPagesNamespaceBlacklist' => $blacklistNS,
19 'wgContentNamespaces' => $contentNS
20 ] );
21 $this->setTemporaryHook( 'ShortPagesQuery', function () {
22 // empty hook handler
23 } );
25 $page = new ShortPagesPage();
26 $queryInfo = $page->getQueryInfo();
28 $this->assertArrayHasKey( 'conds', $queryInfo );
29 $this->assertArrayHasKey( 'page_namespace', $queryInfo[ 'conds' ] );
30 $this->assertEquals( $expectedNS, $queryInfo[ 'conds' ][ 'page_namespace' ] );
33 public function provideGetQueryInfoRespectsContentNs() {
34 return [
35 [ [ NS_MAIN, NS_FILE ], [], [ NS_MAIN, NS_FILE ] ],
36 [ [ NS_MAIN, NS_TALK ], [ NS_FILE ], [ NS_MAIN, NS_TALK ] ],
37 [ [ NS_MAIN, NS_FILE ], [ NS_FILE ], [ NS_MAIN ] ],
38 // NS_MAIN namespace is always forced
39 [ [], [ NS_FILE ], [ NS_MAIN ] ]