Commit graph

46 commits

Author SHA1 Message Date
daniel
759518bdde Fixing dump tests for non-wikitext in NS_MAIN.
Change-Id: I7945a1b950d3b9b394a336813abc8cd1e288766f
2012-10-12 17:34:29 +02:00
daniel
329d5b3516 Merge branch 'Wikidata' into master.
This introduces the ContentHandler facility into MediaWiki,
see docs/contenthandler.txt.

For convenient review, a squashed version is available at
https://gerrit.wikimedia.org/r/27191

The ContentHandler facility is a major building block of the Wikidata project.
It has been discussed repeatedly on wikitech-l.

Change-Id: I3804e2d5f6f59e6a39db80744bdf61bfe8c14f98
2012-10-09 11:34:24 +02:00
Siebrand
430ecafd87 Merge changes I9d2b148e,Iccf6ea81
* changes:
  Clean and repair many phpunit tests (+ fix implied configuration)
  Fix HtmlTest, XmlTest; Add setMwGlobals method to base TestCase.
2012-10-09 06:27:04 +00: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
Siebrand Mazeland
4c0688f4e8 Update version to 1.21.
Change-Id: I0305bb936104eadd60a2f43cdbf7cb676a55d3cb
2012-10-08 20:47:34 +02:00
daniel
12166f46b4 merged master (2012-09-11)
Change-Id: I8e953eaa22f9d331b0af5e780fbeff6d702b23e3
2012-09-11 11:43:02 +02:00
Alexandre Emsenhuber
c293d90acb Remove usage of wfTime() in benchmarks and backupTextPassTest.php
Left the usage in GlobalTest.php since these are tests for
that function.

This function is only a wrapper to microtime( true ),
so it can easily be replaced and deprecated at some point.

Change-Id: I4f7c1f6705e10e2664f8e9be51d86ed5c8ff1e1c
2012-09-06 19:47:17 +02:00
daniel
9994968774 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 15:20:15 +02:00
Daniel Kinzler
392af46809 Revert "merged master"
This reverts commit 67bfdc7a68
2012-08-29 13:14:49 +00:00
daniel
67bfdc7a68 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 12:06:38 +02:00
daniel
96f7db3f7b Avoid deprecation warnings in test cases.
a) when testing deprecated functions, use $this->hideDeprecated() to
suppress warnings.

b) use doEditContent() instead of doEdit()

Change-Id: Ifa9e0ef373ed72ef7d4a3c2dd558483af4a3fd55
2012-08-28 16:00:39 +02:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
Tyler Anthony Romeo
cb3ff28cf1 Removing unused method Status::getXML.
Removed Status::getXML and its single usage in one of the
phpunit maintenance scripts. It is not used anywhere
in any known extension.

Change-Id: I676446647681059449c46c2ff109570a060e0e20
Signed-off-by: Tyler Anthony Romeo <tylerromeo@gmail.com>
2012-08-19 11:17:57 +02:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
Aaron Schulz
9cd080744f Merge "adjust method comment for Ia19f1011" 2012-07-09 20:25:37 +00:00
Aaron Schulz
05cbf1caba Merge "Choose parentids in tests as they are in real dumps" 2012-06-28 17:52:45 +00:00
Christian Aistleitner
85000a975b Choose parentids in tests as they are in real dumps
Change-Id: Ib6e9e0a7bebce2a54c039dea16ddc2115776e777
2012-06-27 22:15:57 +02:00
Christian Aistleitner
6cfae43795 Proper check for false when checking parentid
Change-Id: Ie7154fd3904ef5ed8bb3cecbd10ebddbb67e53f2
2012-06-27 21:49:24 +02:00
daniel
906a1ba51f [bug 37746] string ids for content model and format.
The content model is stored as a varbinary(32), the format
as varbinary(64).

If the standard model resp. format is used, null is written
to the database instead of the actual id, saving space.

Change-Id: I32659b49a9ad3cb8ecae9019562cff7de42b65f9
2012-06-26 15:56:06 +02:00
umherirrender
278ec75070 adjust method comment for Ia19f1011
Change-Id: I2330c3fb1ef5e4c72fe280d02048668a1199f790
2012-06-23 02:22:48 +02:00
daniel
42770ef54d improved failure message for timing-dependant test case
Change-Id: If3bcc4fb55aea6713e9082e249ddbae4ccd26ffc
2012-06-21 19:11:39 +02:00
daniel
17eb1f343d check for </revision> only once. fix parameter list.
Change-Id: Ib88d094efa63baf289c1856ca3cd97a20de9ceb9
2012-06-21 19:11:08 +02:00
daniel
b801fa8b3b merged master
Change-Id: I6cf08c09c7d9b38ecce0b2bbed61431939edd7d4
2012-06-20 19:13:16 +02:00
Tobias Gritschacher
066c4095e7 (bug 37458) permission errors running BaseDumpTest on Windows
Change-Id: I58264c5f516f8dcb124d753b43a80b0875b0e974
2012-06-20 11:14:51 +02:00
Tobias Gritschacher
f4d8597d99 fixed bug 37458: permission errors running BaseDumpTest on Windows
patch set 2: removed trailing whitespace;

Change-Id: I58264c5f516f8dcb124d753b43a80b0875b0e974
2012-06-18 18:20:14 +02:00
umherirrender
f01c89b786 ensure unique revision id in backupTextPassTest
Idb82fe620c3395acaa8f051b4d4d0d770cd33d44 adds a unique contraints on
the revision id to export.xsd, which does not apply here
creating unique contraints in the same way than the pageids by adding an
offset

Change-Id: Ia19f1011a5c0ba8d21cc01a9be2e4d2ed300a80a
2012-06-16 09:09:27 +02:00
Aaron Schulz
d04b8ceea6 Merge "(bug 33222) Add parentid to revision in export xml" 2012-06-16 04:25:52 +00:00
Aaron Schulz
88d7c9ec71 Merge "fix backup unit tests" 2012-06-14 19:32:43 +00:00
daniel
3d58f903d8 Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into Wikidata 2012-06-11 17:45:59 +02:00
Platonides
26aade100d Remove more register_globals remote includes in the tests
backupPrefetchTest.php, backupTextPassTest.php, fetchTextTest.php
and getSlaveServerTest.php

Change-Id: Ie309f4377e4199d80c0f45dc761d3a14b8d00ec2
2012-06-11 15:29:52 +02:00
umherirrender
8a970f5140 fix backup unit tests
Follow up changes I84588e3d9692ee9eb7411b1e391abfc6c9ee89bf and
I030d245715174daeaf24723ebc156ab36761a035

Change-Id: I7e9d6d1e723af41b2af71f44e782f6d49b5f9909
2012-06-10 19:13:24 +02:00
umherirrender
afa123ccf8 (bug 33222) Add parentid to revision in export xml
From bug description: "This is helpful for incremental dumps, to know if
there are revisions missing between the last full dump and this
incremental dump"

Change-Id: I772f976942a306ad573efc659d09714e8250f5ec
2012-06-09 15:41:55 +02:00
daniel
a827739fb5 always record content model and format in export/dumps 2012-06-07 13:02:54 +02:00
jeroendedauw
a7e28d2011 merged master
Change-Id: I4cf7b0f87cd571a6b50f66995dd9ad987a6ecdf8
2012-06-06 16:44:15 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Platonides
92d6102e51 Inherit DumpTestCase from MediaWikiLangTestCase, since
backup_PageTest expect the ContentLanguage to be English
(backupTextPassTest and backup_LogTest also get the change,
but don't require it)

Change-Id: I8b3482df011bccd9fe520ba07c8b8d70de3b9dbb
2012-06-03 16:55:38 +02:00
Aaron Schulz
bc789ee4e6 Merge "reverse text/sha1 output in export to match xsd" 2012-06-03 10:09:08 +00:00
Platonides
72bf1fb244 Add BackupDumper to the tests AutoLoader and kill the
register globals include vulnerability added in 8ba9856.

Change-Id: If7fa6d76c91daa44aa53e80ac39be4860a763723
2012-05-31 22:19:39 +02:00
umherirrender
4e20a471ad reverse text/sha1 output in export to match xsd
Change-Id: I84588e3d9692ee9eb7411b1e391abfc6c9ee89bf
2012-05-31 21:05:40 +02:00
daniel
01f36b721f merged latest master 2012-05-14 23:24:18 +02:00
Christian Aistleitner
76cefaf165 Adding tests for dumps
Change-Id: I9aa3b6d7349458b3e2b2c7111bda739bacc22f9f
2012-04-28 11:37:07 +02:00
Christian Aistleitner
89743db168 Adding Maintenance output tests
Change-Id: Ib2cb36cd840505e2956a6b0978cea1920277d42c
2012-04-15 21:29:07 +02:00
Christian Aistleitner
282554eb33 Employing MediaWikiTestCase's temporary file methods
Change-Id: Ide86541abf6642791c1466a2075436a9df6bdbed
2012-04-10 17:08:06 +02:00
Christian Aistleitner
8ba98560af PHPUnit preparations for tests of maintenance
Change-Id: Id1ac2f8b940e5417e0facaacb7d5ec30b48a9efb
2012-04-03 12:57:10 +02:00