Commit graph

90 commits

Author SHA1 Message Date
Szymon Świerkosz
a6cd69d83a (bug 18195) Allow changing preferences via API
I have created an API module for changing the preferences.
It allows resetting preferences (reset argument) and bulk changes
of preferences (change argument) in a format:
name1=value1|name2=value2

The change argument has a limitation imposed by the current API
implementation as it cannot accept | in values. There is
available a pair of arguments optionname and optionvalue, the
latter accepts values with |.

I have created optionstoken parameter in meta=userinfo to provide
a token. There is already preferencestoken there, but I would
like to have a consistent naming.

Change-Id: I0d6c654a7354ba77e65e338423952a6a78c1150f
2012-04-20 16:56:27 +10:00
Reedy
a521673dc2 Merge "tests related to API block action and its gettoken" 2012-04-06 15:38:25 +00:00
Reedy
cdbfe8db86 tests related to API block action and its gettoken
Add tests for:
 - action=block and action=unblock gettoken
 - attempting to block or unblock a user with no token passed.

Patchset2: use a provider to have tests run against both 'block' and
'unblock' actions.

Change-Id: I686348ff4e2fe419c556acea2fa59dd203dc9440
2012-04-03 22:27:57 +02:00
Reedy
6eb4171a07 Un-marking testMakeNormalBlock as broken...
Change-Id: I5960d71409dc6338249817bc67de5227845dc3d8
2012-04-03 21:16:40 +01:00
Antoine Musso
633c4542c6 disable broken ApiBlockTest::testMakeNormalBlock()
That test has probably always been broken and use an invalid token. The
bug tracking brokenness is http://bugzilla.wikimedia.org/35646

Since the broken test is merged in master, that block the integration of
Jenkins and Gerrit by having any submitted patchset to be reported as
failling :-(

Root cause is https://gerrit.wikimedia.org/r/3434 which made the
Block/Unblock API to actually verify the token previously always
considered valid (bug 34212).

Change-Id: Iecf6b083163c214c734360b2f6d9b4bed8af07dc
2012-04-03 15:08:57 +02: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
Max Semenik
66cb810778 Test that verifies uniqueness of query module prefixes 2012-02-24 18:49:48 +00: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
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Antoine Musso
3bbbe1f867 make sure we test normalization against normalized title
This patch fix ApiQueryTest::testTitlesGetNormalized() when $wgMetaNamespace
would contains space / underscore.

Example:
-8<-------------8<------------8<------------------8<----------8<------
1) ApiQueryTest::testTitlesGetNormalized
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'from' => 'Project:articleA'
-    'to' => 'My_Project:ArticleA'
+    'to' => 'My Project:ArticleA'
 )
-8<-------------8<------------8<------------------8<----------8<------

This patch use Title class logic to forge a normalized title instead of
manually creating it by appending two strings.

Final fix to bug 33663 (comment 21):
https://bugzilla.wikimedia.org/show_bug.cgi?id=33663#c21
2012-01-30 15:54:46 +00:00
Alexandre Emsenhuber
308660c29a Use WikiPage instead of Article to call doDeleteArticle() 2012-01-27 21:21:19 +00:00
Antoine Musso
44b06f908e reverts Concurrency works
trunk is frozen pending stabilisation so we can release MediaWiki 1.19.
Those changes introduces API changes and new SQL tables, so that sounds like
new feature we do not have time to review right now.

Please reapply changes in branches/concurrency and have code review handled
there. Once the branch has been reviewed, please hold. Once trunk is stable
enough and 1.19 got branched, you are welcome to merge the branch in trunk.

Note: we can have a Jenkins jobs setup to run the branch tests if you need.

Reverts:
r108595 r108591 r108585 r108584 108572 r108564 108560 r108559
2012-01-11 09:05:56 +00:00
Ian Baker
65de21c0d4 Commenting these tests out so that CI can run, since I need to leave and nobody uses this code yet.
These fail only on sqlite, and only when run with the entire suite (they're fine when run individually).
Skipping ApiBlockTest allows ApiConcurrencyTest to run, oddly enough.
Clearly, this will need to be fixed ASAP.  I'll take care of it on Thursday when I'm back online, or possibly
before.
2012-01-11 02:48:28 +00:00
Sam Reed
0284615485 Add svn:keywords Id
Trim trailing whitespace

Add explicit member variables
2012-01-10 23:12:00 +00:00
Ian Baker
b3c84ce261 MERGE branches/concurrency 108301:108557 into trunk 2012-01-10 23:03:03 +00:00
Chad Horohoe
d455b3b267 Another @group Broken 2012-01-08 16:40:05 +00:00
Jan Gerber
63030e19b5 Add phpunit tests for chunk upload api.
Follow up r104687
2011-12-27 05:06:41 +00:00
Ian Baker
77320e1994 changed instances of sample.com to example.com per RFC 2606 2011-12-21 22:22:01 +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
Sam Reed
01f410911b Seriously, don't use "wgOut" as a function parameter name 2011-12-13 15:47:04 +00:00
Antoine Musso
7b66f6d486 Better output message for ApiPurgeTests
Follow up r10833
2011-12-12 10:25:29 +00:00
Sam Reed
7a0353b010 Mark the test as broken again seeing as Jenkins isn't happy 2011-12-12 00:07:22 +00:00
Sam Reed
24d9a9f179 Revert r105834, WMF locally after fixing PHPUnit 2011-12-11 23:29:06 +00:00
Sam Reed
49d471c67a Mark testPurgeMainPage broken after r105828 and r105833
PhpUnit is more than broken locally (and phpunit.de is down)
2011-12-11 22:39:48 +00:00
Sam Reed
82ee95eb92 Attempt to fix tests broken by r105828
Test wanted in a specific order, now just look up wanted array key from title row

Untested as my phpunit tests seem to be b0rked locally :(
2011-12-11 21:49:05 +00:00
Antoine Musso
67aebdd165 clean some files when testing upload
This catch temporary uploaded files which are six characters long.

Follow-up r102458
2011-12-08 14:03:04 +00:00
Antoine Musso
a5639ebd58 clean up whitespace / reindent 2011-12-08 13:02:34 +00:00
Jure Kajzer
69e66bdfe9 * reverted changes to Block and ApiBlockTest made in r102625 ... PEBKAC 2011-11-10 09:36:18 +00:00
Jure Kajzer
be3bbfc539 * Added getInfinity to DatabaseOracle
* Block - replaced 'infinity' strings with DB->getInfinity calls
* UploadStash - added sequence value generation for ID
2011-11-10 07:41:12 +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
1d903f20e6 Pass the (correct) session doApiRequest() 2011-10-28 12:18:43 +00:00
John Du Hart
b0a7defa7f Followup r100905, disabling testGetRollbackToken because it reports as failed on Jenkins but no one can reproduce it. 2011-10-27 21:01:28 +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
John Du Hart
998e7c3a86 Followup r100905, fixed the ApiTests 2011-10-27 01:06:50 +00:00
Sam Reed
90e74042b4 Fix comment blocks that start /* to /** 2011-10-11 18:30:50 +00:00
Krinkle
9b9b7df01e Use a username different from the main BlockTest.php, otherwise concurrency errors occur (as seen on Jenkins builds) 2011-09-12 22:18:33 +00:00
Chad Horohoe
a1cd4f0478 rvv (r94406) 2011-08-13 14:00:22 +00:00
Chad Horohoe
6a7172fb99 Purposefully break two tests so I can see how Jenkins reacts to it. Will rv immediately 2011-08-13 13:58:46 +00:00
Chad Horohoe
bb2b97b39d Mostly revert r89400: not needed since Brion fixed the tests in other ways 2011-08-08 16:08:48 +00:00
Chad Horohoe
4a293e11a3 Followup r93928: forgot to remove this 2011-08-04 22:34:26 +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
Chad Horohoe
a11cf96d06 * ApiTest: mark testApiGotCookie() broken, since it is
* ApiTest: partially cleanup testApiListPages() to make it not depend on broken testApiGotCookie(). Not sure what we're testing here, so still marking incomplete.
* ApiWatchTest: mark testWatchClear() as broken rather than skipped due to failing testWatchEdit(). This class needs some love <3
2011-08-02 04:04:03 +00:00
Neil Kandalgaonkar
844ecc5cdb add maxWidth param 2011-08-02 00:36:38 +00:00
Bryan Tong Minh
0cdf9756e8 Add words.txt for us Windows users. This is a random selection of 1000 words from gnuwin32 miscfiles package
Fail more gracefully in RandomImageGenerator
2011-07-15 17:13:24 +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
8c5bae9746 Followup r91270: didn't need to be so paranoid about $_SESSION, and actually was causing more issues than it solved. 2011-07-06 16:56:26 +00:00
Antoine Musso
854b84ef42 enhance tests name (for --testdox option) 2011-07-03 18:09:30 +00:00
Antoine Musso
cde767dd89 throw an exception on !is_executable( $wgExiv2Command ) 2011-07-01 18:34:50 +00:00