Go to the documentation of this file.
22 $requested, $userOptions, $expectedProfile, $expectedNS,
23 $message =
'Profile name and namespaces mismatches!'
35 $context->setRequest(
new FauxRequest( $requested ) );
37 $search->setContext( $context );
47 'ProfileName' => $expectedProfile,
48 'Namespaces' => $expectedNS,
51 'ProfileName' =>
$search->getProfile(),
52 'Namespaces' =>
$search->getNamespaces(),
60 $EMPTY_REQUEST =
array();
72 $EMPTY_REQUEST, $NO_USER_PREF,
73 'default', $defaultNS,
74 'Bug 33270: No request nor user preferences should give default profile'
77 array(
'ns5' => 1 ), $NO_USER_PREF,
78 'advanced',
array( 5 ),
79 'Web request with specific NS should override user preference'
82 $EMPTY_REQUEST,
array(
85 ) + array_fill_keys( array_map(
function ( $ns ) {
88 'advanced',
array( 2, 14 ),
89 'Bug 33583: search with no option should honor User search preferences'
90 .
' and have all other namespace disabled'
101 if ( $opt ===
null ) {
117 # Initialize [[Special::Search]]
122 # Simulate a user searching for a given term
123 $term =
'{{SITENAME}}';
126 # Lookup the HTML page title set for that page
134 '/' . preg_quote(
$term ) .
'/',
136 "Search term '{$term}' should not be expanded in Special:Search <title>"
WebRequest clone which takes values from a provided array.
static newFromId( $id)
Static factory method for creation from a given user ID.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
setUser(User $u)
Set the User object.
static defaultNamespaces()
An array of namespaces indexes to be searched by default.
newUserWithSearchNS( $opt=null)
Helper to create a new User object with given options User remains anonymous though.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Group all the pieces relevant to the context of a request into one instance.
static provideSearchOptionsTests()
Allows to change the fields on the form that will be generated $name
testProfileAndNamespaceLoading( $requested, $userOptions, $expectedProfile, $expectedNS, $message='Profile name and namespaces mismatches!')
@covers SpecialSearch::load @dataProvider provideSearchOptionsTests
implements Special:Search - Run text & title search and display the output
testSearchTermIsNotExpanded()
Verify we do not expand search term in <title> on search result page https://gerrit....
Test class for SpecialSearch class Copyright © 2012, Antoine Musso.
the value to return A Title object or null whereas SearchGetNearMatch runs after $term
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as