Commit graph

12 commits

Author SHA1 Message Date
Alexander Vorwerk
65015ad2d8 Hard deprecate global function wfLocalFile()
The global function wfLocalFile() is deprecated since 1.34 and unused.
This patch now makes it emit deprecation warnings.

Change-Id: Ib9f94b4f49e7720bd4455d019995037eaa4e3980
2021-05-18 14:59:25 +00:00
DannyS712
0483225872 LocalFileTest: use assertInstanceOf
Instead of reinventing the wheel

Change-Id: I5c596c0355c6a0f19abeb1927587bceec749f91c
2021-03-12 16:55:59 +00:00
addshore
959bc315f2 MediaWikiTestCase to MediaWikiIntegrationTestCase
The name change happened some time ago, and I think its
about time to start using the name name!
(Done with a find and replace)

My personal motivation for doing this is that I have started
trying out vscode as an IDE for mediawiki development, and
right now it doesn't appear to handle php aliases very well
or at all.

Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
2020-06-30 17:02:22 +01:00
Aryeh Gregor
b4a7620b9e Hard-deprecate Title::getUserCaseDBKey
The only use-case for this was if the local wiki's File namespace didn't
allow initial-lowercase names but a remote repo did. This case is
unlikely to be useful and was broken anyway, so it's now prohibited, and
getUserCaseDBKey is no longer needed. It's now an alias for getDBkey
until we remove it.

This includes a breaking change to
MediaWikiTitleCodec::splitTitleString, but that was always intended as
an internal method and I have now marked it officially as such. There is
one caller in code search outside core (JsonConfig), but it looks like
it will be unaffected.

Bug: T202094
Depends-On: I4b8ceb8a7f4624d6a3763aca6df41bf1a0d7293f
Depends-On: I724be15e93421f874fb202f0ec2ca6940e56a20a
Change-Id: I4fd64d4b0036b6dabdcfeee18766df18bf538542
2019-10-24 19:26:37 +03:00
Thiemo Kreuz
e06ce9f467 tests: Prefer PHPUnit's assertSame() when comparing empty strings
assertSame() is guaranteed to never do any magic type conversion.
This can be critical when accidentially comparing empty strings (a
value PHP considers to be "falsy") to false, 0, 0.0, null, and such.

Change-Id: I2e2685c5992cae252f629a68ffe1a049f2e5ed1b
2019-09-20 15:27:58 +00:00
daniel
bdc6b4e378 LocalFile: avoid hard failures on non-existing files.
Some methods on LocalFile will fatal if called on a non-existing file.
ApiQueryImageInfo did not take that into account.

This patch changes LocalFile to avoid fatal errors, and ApiQueryImageInfo
to not try and report information on non-existing files.

NOTE: the modified code has NO test coverage! This should be fixed
before this patch is applied, or the patch needs to be thoroughly tested
manually.

Bug: T221812
Change-Id: I9b74545a393d1b7a25c8262d4fe37a6492bbc11e
2019-09-18 09:18:44 +00:00
Thiemo Kreuz
c0e27fba86 Add missing property declarations to LocalFileTest
Change-Id: I518a7a939042110f7ca67b0697e35e2e35105a08
2019-01-02 15:25:44 +01:00
Umherirrender
45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00
Reedy
1834ee3d8e Fix numerous class/function casing
Change-Id: I23982bfa0548c9ea3bdb432be7982f1563930715
2016-03-18 23:14:49 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Kunal Mehta
790eb5810f LocalFileTest does not require database access
Change-Id: Iea4a2758a1169b212c15ceb4445b2e2a0458df1a
2015-03-26 17:36:14 -07:00
umherirrender
1d8b52fbfd Move Test files under same folder structure where class is (/includes/)
Change-Id: I95f1aa6f0ed2cc3306aa6e588a11f359854315c1
2014-12-16 21:56:44 +01:00
Renamed from tests/phpunit/includes/LocalFileTest.php (Browse further)