Commit graph

32 commits

Author SHA1 Message Date
Timo Tijhof
f14c11f1b5 Remove left-over references from comments to removed FSRepo class
Follows-up 8b18ae7b5.

Change-Id: I10badb3e4648b2b32168a8aaad35855b2f6ae35e
2017-01-07 16:00:07 +00:00
Aaron Schulz
c4d275b7d5 Remove FileRepoStatus references
Change-Id: I03190273670f5c255423cf59019cbf12220c5498
2016-12-21 19:07:33 +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
Timo Tijhof
9bd8dc6e2d filerepo: Use standard method for creating temp dir in unit test
Previously, the unittests-thumb directory (and its hashed subdirectories,
and the .htaccess and index.html files) were being left behind.

While that may be a bug in the FileBackend class, the unit test
shouldn't rely on that for its teardown. If we want to assert that,
that can be a separate test.

Bug: T89085
Change-Id: Ided46b71ace82159864145b76d98bb10da5d0311
2015-02-11 01:42:12 +00:00
addshore
892a992ab8 Remove MediaWikiPHPUnitCommand
All functionality has been moved to other places

Change-Id: I6b6b0ef846bc63108c4dff9e17098432fd9d1697
2014-08-02 21:35:34 +00:00
Bartosz Dziewoński
fd718959b6 Copy various random files used by tests to tests/phpunit/data
The tests currently depend on them never being renamed, which is bad.
(Actual file data in git is de-duplicated automatically AFAIK.)

Change-Id: Id2440326981218f9e7d51541a168db59183fdadf
2014-06-03 22:52:51 +02:00
Siebrand Mazeland
896bda7c85 Pass phpcs-strict on some test files (7/11)
Change-Id: Ia0ceea60e7ef43959f868378f3fcd463a3adf782
2014-04-24 18:27:12 +00:00
umherirrender
092cd8ee31 Fixed some @params documentation (tests)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Ic8aaf0a93796b97d0fa4617c1f86ff59f4b36131
2014-04-17 20:43:42 +02:00
Aaron Schulz
2aa84651ca filebackend: cleaned up the FileBackend constructor
* Added some b/c code with deprecation warnings

Change-Id: Ifceffbc0a37a223bcd7cd3dc60181fc85765bc46
2013-12-03 13:57:01 -08:00
Aaron Schulz
2f29c7551b Revert "filebackend: cleaned up the FileBackend constructor"
Actually this messes with the implicit backend made for things like Math (when unconfigured), which uses the "new" operator.

This reverts commit 1f129a22cb.

Change-Id: I4c72c4f7c8b82e38df5496cf2b90fc9e19c40334
2013-12-03 20:40:24 +00:00
Aaron Schulz
1f129a22cb filebackend: cleaned up the FileBackend constructor
* Moved some of the graph construction work to FileBackendGroup.
  This helps the code in not depending on the rest of MW so much.
* Updated tests and FileBackendMultiwrite, which are the only things
  directly constructing FileBackend objects.

Change-Id: I188a053c70ce088ce34613d5db40e6708e3ea9b7
2013-11-23 20:21:53 -08:00
addshore
4e941cf4ca Add @covers tags for more tests
Change-Id: Iff3af78e9b41c445b7f066b6c0d0f4a87d2d6c4e
2013-10-21 11:28:39 +02:00
Siebrand Mazeland
791d0b2a98 Update code formatting
Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
2013-04-26 14:21:20 +00:00
Siebrand Mazeland
de04f37ef1 Update formatting
5 of n.

Change-Id: I811ca957b6588085d67606ebc0cd4033a1e53839
2013-02-15 12:35:50 +00:00
Antoine Musso
0fd05285d7 pass codesniffer on tests/
Fix almost all occurences of the following sniffs:

Generic.CodeAnalysis.UselessOverridingMethod.Found
Generic.Formatting.NoSpaceAfterCast.SpaceFound
Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma
Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine
Generic.PHP.LowerCaseConstant.Found
PSR2.Classes.PropertyDeclaration.ScopeMissing
PSR2.Files.EndFileNewline.TooMany
PSR2.Methods.MethodDeclaration.StaticBeforeVisibility

Change-Id: I96aacef5bafe5a2bca659744fba1380999cfc37d
2013-01-28 12:14:26 +01:00
Timo Tijhof
181c7cdc8e Clean and repair many phpunit tests (+ fix implied configuration)
This commit depends on the introduction of
MediaWikiTestCase::setMwGlobals in change Iccf6ea81f4.

Various tests already set their globals, but forgot to restore
them afterwards, or forgot to call the parent setUp, tearDown...

Either way they won't have to anymore with setMwGlobals.

Consistent use of function characteristics:
* protected function setUp
* protected function tearDown
* public static function (provide..)

(Matching the function signature with PHPUnit/Framework/TestCase.php)

Replaces:
 * public function (setUp|tearDown)\(
 * protected function $1(

 * \tfunction (setUp|tearDown)\(
 * \tprotected function $1(

 * \tfunction (data|provide)\(
 * \tpublic static function $1\(

Also renamed a few "data#", "provider#" and "provides#" functions
to "provide#" for consistency. This also removes confusion where
the /media tests had a few private methods called dataFile(),
which were sometimes expected to be data providers.

Fixes:

TimestampTest often failed due to a previous test setting a
different language (it tests "1 hour ago" so need to make sure
it is set to English).

MWNamespaceTest became a lot cleaner now that it executes with
a known context. Though the now-redundant code that was removed
didn't work anyway because wgContentNamespaces isn't keyed by
namespace id, it had them was values...

FileBackendTest:
* Fixed: "PHP Fatal: Using $this when not in object context"

HttpTest
* Added comment about:
  "PHP Fatal: Call to protected MWHttpRequest::__construct()"
  (too much unrelated code to fix in this commit)

ExternalStoreTest
* Add an assertTrue as well, without it the test is useless
  because regardless of whether wgExternalStores is true or false
  it only uses it if it is an array.

Change-Id: I9d2b148e57bada64afeb7d5a99bec0e58f8e1561
2012-10-09 03:01:51 +02:00
Antoine Musso
a8ca2e0e3b raise filerepo tests timeout to 10sec
'@group medium' instructs PHPUnit to wait up to 10 seconds for the test
to complete. That would save us from false positive caused by high disk
I/O on the continuous integration server.

Change-Id: Id11c3ed1879705f806d262dc8090ef2fb432ed36
2012-08-29 17:01:02 +02:00
Aaron Schulz
ece8bb5e6f r110180: fixed copy-paste cruft for custom backend code. Also made backend names consistent. 2012-01-28 00:43:55 +00:00
Aaron Schulz
6c784b1812 Fixed a bunch of dir leakage 2012-01-27 22:46:55 +00:00
Aaron Schulz
c1c6433bfc * In NewParserTest, refactored code to use FileBackend (bug 31737). Also made some speed improvements and made regex= not flood the output with 600 items of crap.
* In FileBackendTest, call clean() on the dirs *after* deleting all the files first.
* Speed improvements to MediaWikiTestCase.
2012-01-25 23:11:53 +00:00
Aaron Schulz
609cf8d522 * Modified StoreBatchTest and FileBackendTest to allow specifying a registered backend to use
* Improved FileBackendTest file pruning and added more getFileList() tests
2012-01-22 00:34:04 +00:00
Aaron Schulz
eb92ac5557 * Added FileBackend::parentStoragePath() convenience function for getting parent directories.
* In StoreBatchTest: sed proper clean() function to remove temp dirs (follows up r109641). Also removed some commented out code.
* Fixed temp dir leakage in FileBackendTest.
2012-01-20 22:46:35 +00:00
Platonides
3f76d9e2b0 Fix folder leakage. 2012-01-20 20:15:26 +00:00
Antoine Musso
79c979b4e8 tests: mark tests requiring a database connection 2012-01-18 15:50:00 +00:00
Aaron Schulz
76298accc0 * Added 'basePath' config param to FSFileBackend and tweaked it to behave more similarly to the backends with real containers (e.g. everything else). Resolution to absolute paths is now deferred after resolveStoragePath(), using resolveToFSPath().
* Fixed whitespace in FSFileIterator.
2012-01-12 18:44:00 +00:00
Antoine Musso
0323c900f7 StoreBatchText note about using custom repo
follow up r108308
2012-01-10 14:26:17 +00:00
Aaron Schulz
d010652a6d Dependency inject the repo/backend for proper testing rather than relying on the wiki config 2012-01-07 06:13:01 +00:00
Ian Baker
77320e1994 changed instances of sample.com to example.com per RFC 2606 2011-12-21 22:22:01 +00:00
Russ Nelson
7f16501760 clean up temp files. Fixes r99546 only better this time. 2011-12-16 20:01:08 +00:00
Russ Nelson
9e74cdbd21 clean up temp files. Fixes r99546 2011-12-16 19:59:58 +00:00
Russ Nelson
95971a5351 StoreBatchTest counts now correct, and using assertEquals 2011-10-16 22:18:18 +00:00
Russ Nelson
b3881a28c1 Some docs and a test for FileRepo::storeBatch() 2011-10-11 19:49:29 +00:00