aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiUploadTest.php
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix spacing and break some linesumherirrender2013-08-241-7/+7
| | | | Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
* phpcs: Fix WhiteSpace.LanguageConstructSpacing warningsTimo Tijhof2013-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Update code formattingSiebrand Mazeland2013-04-261-3/+1
| | | | Change-Id: I16a9b42651f1cfb1a70dffbb67b7b83dfeb90d03
* Remove unused local variables in testsSiebrand Mazeland2013-04-261-9/+7
| | | | Change-Id: I71318eb7d8c00bfc1ce6d2fc636b498f7a695f42
* Update formattingSiebrand Mazeland2013-02-141-44/+38
| | | | | | 3 of n. Change-Id: I62ad009018c54da6cf081c334e44eb98a3c72695
* apitests leaks wgUserumherirrender2013-02-081-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Regroup all API tests in the 'API' PHPUnit groupAntoine Musso2012-04-021-0/+1
| | | | | | | | | | | | | 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
* disable ApiUploadTestAntoine Musso2012-02-061-0/+3
| | | | | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110790
* Add phpunit tests for chunk upload api.Jan Gerber2011-12-271-1/+139
| | | | | | | | Follow up r104687 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107361
* Merged FileBackend branch. Manually avoiding merging the many prop-only ↵Aaron Schulz2011-12-201-1/+1
| | | | | | | changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106752
* Mark as FIXME. This three calls leak a png filename in sys_get_temp_dir() each, Platonides2011-11-081-3/+3
| | | | | | | | tempnam() like, not the two-words filenames of RandomImageGenerator::getRandomFilenames() They aren't produced by ApiTestCaseUpload::fakeUploadFile() either. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102458
* Fix for r100905:Alexandre Emsenhuber2011-10-271-25/+17
| | | | | | | | | | * 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() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101024
* we must have a session when testing Api upload.Antoine Musso2011-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100959
* Fixes for r92251:Chad Horohoe2011-08-041-4/+5
| | | | | | | | * 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93928
* Refactored UploadStash and related classes to use the database for file ↵Ian Baker2011-07-121-5/+5
| | | | | | | | | | metadata storage instead of the session, see bug 26179 Tweaked the UploadWizard to work properly with the new backend code, updated tests Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92009
* Remove notes about being destructive. We work properly on cloned tables nowChad Horohoe2011-07-061-2/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91568
* Fixed a long-standing broken test:Chad Horohoe2011-06-301-0/+1
| | | | | | | | | | | | 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91215
* Apply modification of mdale's patch from Bug #28420: “Re-factor upload ↵Mark A. Hershberger2011-04-061-240/+2
| | | | | | | tests to support extensions extending upload test case” Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/85566
* Followup r83140: FakeMemCachedClient -> EmptyBagOStuff in testsChad Horohoe2011-03-031-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83144
* Per Platonides, fix for r82686: make ApiUploadTest work againAlexandre Emsenhuber2011-03-021-5/+7
| | | | | | | | 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 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/83080
* Fix r79532: Strct standardsX!2011-01-041-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/79569
* Refactor much of the API testing code. X!2011-01-021-0/+2
| | | | | | | | | | | 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/79476
* Use an autoloader for the tests, following the ideas from r72858.Platonides2011-01-011-4/+1
| | | | | | | The SeleniumTestConstants class was added in r79437 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/79443
* * verbose and color default output from phpunitChad Horohoe2010-12-281-1/+1
| | | | | | | | * Make a bunch of tests subclass MediaWikiTestCase * Parser tests and ResourceLoaderTest can't subclass it yet due to various issues Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/79117
* This path changed when moving the tests folder.Platonides2010-12-161-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78493
* Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. ↵Chad Horohoe2010-12-141-0/+671
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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/78383