Needs to call parent::tearDown() after the table reset.
Use direct assertion and MediaWikiTestCase abstraction
where possible
Change-Id: Iad00569867e6f9a4579ae93b22fc0f570cde6bd7
Deprecated since 1.35, not compatible with PHPUnit 8. This could've
happened earlier, but here we go.
Unused in known repos (except for the sniff looking for this usage):
https://codesearch.wmcloud.org/search/?q=assertType%5C(&i=nope&files=php&repos=
Bug: T192167
Change-Id: I479cf71d0941c35096d21686077b4d1cbc4f898d
The problem was that when using $user->getBlock
within checkCondition (APCOND_BLOCKED) caused a infinite
recursion as calling getBlock eventually leads back to checkCondition.
The fix here is to stop using userHasRight as that is the cause of the recursion.
This also fixes testGetUserAutopromoteBlockedDoesNotRecurse test so it
shouldn't fail.
Bug: T270145
Change-Id: Ic751eba70730de286bbd55772bd7562459fb30b4
Emit deprecation notices in the constructor
if falling back to $wgUser, and fix core
calls
Bug: T246861
Depends-On: I51117931d527a3bdda468b48de577a7faafbcd69
Change-Id: Ibd0a8ffd0494c17a378cc43e6b6164166130adf4
If I try to run ApiMainTest with GlobalPreferences enabled, it takes
forever (or at least some number of minutes) to run. This is because
when @depends is used to transfer data from one test to another via
the return value, PHPUnit runs Enumerator::enumerate() on the data. When
it contains a reference to the active TestCase, PHPUnit ends up
iterating through its internal data structures, which takes a long time.
My conclusion is that @depends with a return value should be considered
harmful. Stop doing it in ApiMainTest. Stop recommending it in
SampleTest.
Change-Id: I63e94f2886a4ee4b3fd0ea6b19cd2fb67ba912de
Some User methods fail if they are called before $wgRequest is
set. But according to the Setup.php comment, it is only set for b/c.
The global request object can be lazy-initialised at any time.
This is sufficient to avoid T263911 (loss/obfuscation of the $wgServer
error message).
In tests, try to keep $wgRequest and RequestContext::$request in sync.
Introduce MediaWikiIntegrationTestCase::setRequest() which sets both at
once, and use that instead of setMwGlobals() or direct assignment.
BlockManagerTest was accidentally exploiting the fact that the global
context request and $wgRequest were separate objects. Making them the
same causes session cookies to appear in the response, breaking the
cookie counts. Use a new response for the test.
Bug: T263911
Bug: T245940
Change-Id: I2be99f7251a837bc6b62be0b152038157dec10f2
Not all classes are matched correctly in feed output because of
regex used. Fixed it by updating regex and adding unit tests
Bug: T36801
Change-Id: I6e7a883caee2a36c11966991b19ba93c229683cf
This patch adds a method named WikiPage::doUserEditContent() as an interim
replacement to existing deprecated ::doEditContent() method. The new
method requires $user to be passed as a parameter and no longer supports
passing in the unused $serialFormat parameter. The new method otherwise
behaves identically compared to the old doEditContent() method.
Bug: T255507
Change-Id: Ibc0052b27a6d3cda3eb9663b95b4f45116dcc9f1
Previously, the order of styles outputted by this module was
arbitrary, based on the order of the feature files passed in.
This was not how it was intended to work - the ResourceLoaderSkinModule
should be aware of the correct ordering.
In the case of normalize for example - it should always be the first
file output.
The implementation is adapted to check for valid features once in
the constructor and to also consider a DEFAULT_FEATURES value has been
set.
We use the FEATURE_FILES constant to determine
the order of CSS output.
This is all documented in the class.
Bug: T269618
Change-Id: Iecbf11b5f09882e55d694651210d6d132d3cd412
This replaces the 'requirements' from parser tests (hooks and
functionhooks) with a more flexible 'options' clause to allow
additional file-level requirements/options to support running parser
tests in multiple modes. (For example, with the legacy parser or in
one of two parsoid modes.)
Bug: T254181
Depends-On: I636bd1f2c8aee327acbbd1636e2ac76355f1d80e
Change-Id: I58373d135c3a804f4ce9967112c338435f5cd4b6
Several important extensions (Disambiguator, ProofreadPage, and
SoftRedirector) use the GetLinkColours hook to add additional CSS
classes to links on article pages. Parsoid previously relied on
backdoor knowledge of the way Disambiguator used the page property
table to support these, but they should be exported properly from the
API.
Bug: T237538
Change-Id: I945940aa872541d7e01f1e543ca854231c857fe2
Should be a no-op, doesn't actually reduce the places where $wgUser
is set, just reduces the number of hits in codesearch and makes the
future migration of LanguageConverter to not use $wgUser a bit
easier
Bug: T243708
Change-Id: Ieb04b0e760dd37e037a95408ef429ac5c510f1d9
This trait is used in class LanguageIntegrationTest, resulting in the
language code "integration" being used, which is an invalid language.
Change-Id: I9398015bb0e85eb26116bb8608c8f39216ce8204
A difference between UNIX and Windows is the dir separator,
which makes this test failing, because the file name does not match to
filter out the psr4 loaded classes to just keep the alias, which must be
part of the autoloader class list.
1) AutoLoaderStructureTest::testAutoLoadConfig
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
'ParserTestFileSuite' => '[...]...te.php'
'ParserTestTopLevelSuite' => '[...]...te.php'
'SuiteEventsTrait' => '[...]...it.php'
+ 'MediaWiki\Block\DatabaseBlock' => '[...]...ck.php'
+ 'MediaWiki\SpecialPage\SpecialPageFactory' => '[...]...ry.php'
+ 'MediaWiki\Revision\IncompleteRevisionException' =>
'[...]...on.php'
+ 'MediaWiki\Revision\MutableRevisionRecord' => '[...]...rd.php'
+ 'MediaWiki\Revision\MutableRevisionSlots' => '[...]...ts.php'
+ 'MediaWiki\Revision\RevisionAccessException' => '[...]...on.php'
+ 'MediaWiki\Revision\RevisionArchiveRecord' => '[...]...rd.php'
+ 'MediaWiki\Revision\RevisionFactory' => '[...]...ry.php'
+ 'MediaWiki\Revision\RevisionLookup' => '[...]...up.php'
+ 'MediaWiki\Revision\RevisionRecord' => '[...]...rd.php'
+ 'MediaWiki\Revision\RevisionSlots' => '[...]...ts.php'
+ 'MediaWiki\Revision\RevisionStore' => '[...]...re.php'
+ 'MediaWiki\Revision\RevisionStoreRecord' => '[...]...rd.php'
+ 'MediaWiki\Revision\SlotRecord' => '[...]...rd.php'
+ 'MediaWiki\Revision\SuppressedDataException' => '[...]...on.php'
)
Change-Id: I1485cc7309c20d131f398473367d281a3ce78a25
Needs to be a real path, not relative one
6) FileTest::testGetThumbnailSource with data set #2 (array(true,
array('/tmp'), 1024, 2048, '/tmp', 'Temporary path because temp f...
found'))
Temporary path because temp file was found
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'/tmp'
+'fsFilePath'
The file_exists in File::getThumbnailSource gets the path '/tmp' and
that does not exists on windows, because it is relative to one of the
core folder
Change-Id: I8618c8b34261451da42f88360a9d65353960e91f
These accounts are usually very old and User::getRegistration returns
null for them because user_registration is null. Treat these accounts
as old enough to be in the most experienced group and only decide
on edit count. Fix queries in recent changes to avoid comparisons
with nulls as well.
Also improve documentation of User::getExperienceLevel.
Change-Id: I6090cf9b9097069469e8e547b217f0d16f0fe372