Commit graph

27 commits

Author SHA1 Message Date
MatmaRex
61b3f8ad58 No spaces within (casts)
Per the code conventions ([[mw:CC/PHP]]).

This file appears to be the only outlier.

Change-Id: I634d9927174737ffc99976a97a41ce04c842fc32
2013-08-31 18:17:28 +02:00
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
Timo Tijhof
50e7985d4d phpcs: Fix WhiteSpace.LanguageConstructSpacing warnings
Squiz.WhiteSpace.LanguageConstructSpacing:
   Language constructs must be followed by a single space;
   expected "require_once expression" but found
   "require_once(expression)"

It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.

Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.

It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.

Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
2013-05-09 05:56:26 +02:00
Siebrand Mazeland
791d0b2a98 Update code formatting
Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
2013-04-26 14:21:20 +00:00
Siebrand Mazeland
483e29277f Remove unused local variables in tests
Change-Id: I71318eb7d8c00bfc1ce6d2fc636b498f7a695f42
2013-04-26 09:48:46 +02:00
Siebrand Mazeland
419b02b6df Update formatting
3 of n.

Change-Id: I62ad009018c54da6cf081c334e44eb98a3c72695
2013-02-14 12:56:23 +01:00
umherirrender
2a29335af9 apitests leaks wgUser
1) ParserTests::testParserTest with data set #468 ('pre-save transform:
Signature expansion', '* ~~~
* <noinclude>~~~</noinclude>
* <includeonly>~~~</includeonly>
* <onlyinclude>~~~</onlyinclude>', '*
[[Special:Contributions/127.0.0.1|127.0.0.1]]
* <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
*
<includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
*
<onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>',
'pst', '')
pre-save transform: Signature expansion
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'* [[Special:Contributions/127.0.0.1|127.0.0.1]]
-* <noinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</noinclude>
-*
<includeonly>[[Special:Contributions/127.0.0.1|127.0.0.1]]</includeonly>
-*
<onlyinclude>[[Special:Contributions/127.0.0.1|127.0.0.1]]</onlyinclude>'
+'* [[User:Apitestsysop|Apitestsysop]] ([[User talk:Apitestsysop|talk]])
+* <noinclude>[[User:Apitestsysop|Apitestsysop]] ([[User
talk:Apitestsysop|talk]])</noinclude>
+* <includeonly>[[User:Apitestsysop|Apitestsysop]] ([[User
talk:Apitestsysop|talk]])</includeonly>
+* <onlyinclude>[[User:Apitestsysop|Apitestsysop]] ([[User
talk:Apitestsysop|talk]])</onlyinclude>'

Change-Id: Ia72f9242deb5c6109d38b56dd46ef92fa6386278
2013-02-08 18:57:16 +01:00
Antoine Musso
da8ba7c544 Regroup all API tests in the 'API' PHPUnit group
That will let us tests all the API tests by using PHPUnit group
filtering such as:

 php phpunit.php --group API

Also cleaned some whitespaces

Patchset-4: skipped files that had only whitespace changes

Change-Id: I51e03d910521b061f505e3a9b11a08c7b95f1538
2012-04-02 16:55:31 +02:00
Antoine Musso
c9c00ef397 disable ApiUploadTest
ApiUploadTest gives inconsistent results which trigger false alamrs to all
the ops team. We are disabling those tests for now.

See https://bugzilla.wikimedia.org/26169
2012-02-06 21:39:56 +00:00
Jan Gerber
63030e19b5 Add phpunit tests for chunk upload api.
Follow up r104687
2011-12-27 05:06:41 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
Platonides
a469cf2c95 Mark as FIXME. This three calls leak a png filename in sys_get_temp_dir() each,
tempnam() like, not the two-words filenames of RandomImageGenerator::getRandomFilenames()
They aren't produced by ApiTestCaseUpload::fakeUploadFile() either.
2011-11-08 22:27:25 +00:00
Alexandre Emsenhuber
681523d5ad Fix for r100905:
* Make tests work again
* Added ApiTestCase::doApiRequest() and related to pass it to the context and removed override of $wgUser where possible
* Fix ApiLogin to get the correct User object (i.e. the logged in one)
* Fix ApiBase to feed a RequestContext to setContext() so that ApiLogin can call setUser()
2011-10-27 18:46:40 +00:00
Antoine Musso
7f2e429c17 we must have a session when testing Api upload.
For some reason, the ApiUploadTest::testLogin method no more returns a valid
session. Since most, if not all, of the ApiUploadTest tests depends on it
we want that testLogin method to fail so we can skip the rest of the tests.

Test command:
  ./phpunit.php --filter ApiUpload --tap

BEFORE:
=======

TAP version 13
array(0) {
}
ok 1 - ApiUploadTest::testLogin
ok 2 - ApiUploadTest::testUploadRequiresToken
not ok 3 - Error: ApiUploadTest::testUploadMissingParams
not ok 4 - Error: ApiUploadTest::testUpload
^C

AFTER:
======

TAP version 13
not ok 1 - Failure: ApiUploadTest::testLogin
  ---
  message: 'API Login must return a session'
  severity: fail
  ...
ok 1 - # SKIP This test depends on "ApiUploadTest::testLogin" to pass.
ok 1 - # SKIP This test depends on "ApiUploadTest::testLogin" to pass.
^C ... more skips
2011-10-27 10:28:25 +00:00
Chad Horohoe
e018780327 Fixes for r92251:
* Move Imagick check into getImageWriteMethod(), adjust exception catching. Previously this was bailing on the test if you have convert but not the PHP Imagick extension. Now all these tests are passing for me again.
* Rm unused member variable, whitespace, etc
2011-08-04 22:33:04 +00:00
Ian Baker
9d4fd0c567 Refactored UploadStash and related classes to use the database for file metadata storage instead of the session, see bug 26179
Tweaked the UploadWizard to work properly with the new backend code, updated tests
2011-07-12 21:11:43 +00:00
Chad Horohoe
732e3f1271 Remove notes about being destructive. We work properly on cloned tables now 2011-07-06 17:52:27 +00:00
Chad Horohoe
25bf6f5b43 Fixed a long-standing broken test:
1) ApiUploadTest::testUploadStash
Failed asserting that <boolean:true> is false.

Did this by copying the correct stuff from $_SESSION to our local $session we're using for the test. Not sure if this is strictly correct, but hey it passes ;-)

Currently at: Tests: 1622, Assertions: 32090, Incomplete: 8, Skipped: 5.
2011-06-30 20:11:45 +00:00
Mark A. Hershberger
4e9b2c5c53 Apply modification of mdale's patch from Bug #28420: “Re-factor upload tests to support extensions extending upload test case” 2011-04-06 19:50:54 +00:00
Chad Horohoe
b661588c1f Followup r83140: FakeMemCachedClient -> EmptyBagOStuff in tests 2011-03-03 12:55:22 +00:00
Alexandre Emsenhuber
60f1302644 Per Platonides, fix for r82686: make ApiUploadTest work again
Added option request parameter to User::editToken() and User::matchEditToken() and use them where possible from the api.
Also removed $_SESSION usage since it's no longer needed
2011-03-02 12:52:47 +00:00
X!
e23d09cfee Fix r79532: Strct standards 2011-01-04 11:58:17 +00:00
X!
ad6875383b Refactor much of the API testing code.
Old: ApiWatchTest not only tested the watch module, but also tested the login module,
     and the login module test was also used to log in to the API for the other tests.
New: ApiWatchTest only contains watch-specific methods. The login testing has been moved
     to ApiTest. The code used to log in and get tokens have been moved to ApiSetup. Nice,
     organized, and much nicer than before. ApiUploadTest is still pretty fugly, though.
2011-01-02 05:52:00 +00:00
Platonides
f78ae2a51a Use an autoloader for the tests, following the ideas from r72858.
The SeleniumTestConstants class was added in r79437
2011-01-01 22:04:14 +00:00
Chad Horohoe
447529064b * verbose and color default output from phpunit
* Make a bunch of tests subclass MediaWikiTestCase
* Parser tests and ResourceLoaderTest can't subclass it yet due to various issues
2010-12-28 18:17:16 +00:00
Platonides
0a59772372 This path changed when moving the tests folder. 2010-12-16 15:09:50 +00:00
Chad Horohoe
23f69f10ed Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're not strictly maintenance scripts, and some people want to do a selective checkout that doesn't include the tests. There's still debate on whether we should include these in the release downloads, but we had a pretty firm consensus to move this. 2010-12-14 16:26:35 +00:00