aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/ArticleTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Move Test files under same folder structure where class is (/includes/)umherirrender2014-12-161-95/+0
| | | | Change-Id: I95f1aa6f0ed2cc3306aa6e588a11f359854315c1
* Add deprecation messages to static methods in Article.phpwithoutaname2014-06-241-0/+1
| | | | | | | The referenced hooks simply call the corresponding hooks in WikiPage.php, so it would be better to call them from WikiPage.php directly. Change-Id: Ia0cf526c625d38cd941a1166876c13697be87a86
* Pass phpcs-strict on some test files (1/x)Siebrand Mazeland2014-04-241-1/+3
| | | | Change-Id: I7f8dee09ac734cbc369441431841f2d4aa5d7f51
* @covers tags for inclues/*Testaddshore2013-10-241-14/+14
| | | | Change-Id: Id28acdd8fe0028bf1e46344cfed131076c8f4c95
* Fix scope on all /phpunit test methodsaddshore2013-10-241-6/+6
| | | | Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af
* Update formattingSiebrand Mazeland2013-02-141-3/+3
| | | | | | 1 of n. Change-Id: I852729f08bbb0c5e39c2db44362ccdc7f59dcc08
* hideDeprecated( 'CategoryPage::getAutosummary' )Platonides2012-12-071-0/+1
| | | | | | | | check-vars correctly detects the call to CategoryPage::getAutosummary as deprecated by coming from Article::getAutosummary but needs an explicit hideDeprecated() to not complain about it. Change-Id: I8a51a3041cc4cab592c5e37862efb69b538821a0
* tests: always call parent setUpAntoine Musso2012-10-231-2/+2
| | | | | | | | Some class extending MediaWikiTestCase did not call its setUp method. We most probably always want to do it since MediaWikiTestCase::setUp() does garbage collection and might do more in the future. Change-Id: I68dde370a62c8f4a779836ca0c4ad06844fdc916
* Merge branch 'Wikidata' into master.daniel2012-10-091-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Avoid deprecation warnings in test cases.daniel2012-08-281-0/+3
| | | | | | | | | | | | | | | | | | a) when testing deprecated functions, use $this->hideDeprecated() to suppress warnings. b) use doEditContent() instead of doEdit() Change-Id: Ifa9e0ef373ed72ef7d4a3c2dd558483af4a3fd55
* | Clean and repair many phpunit tests (+ fix implied configuration)Timo Tijhof2012-10-091-6/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Need to set mDataLoaded so that this works without a dbPlatonides2011-12-271-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/107419
* Follow-up r105790: make tests work againAlexandre Emsenhuber2011-12-111-6/+6
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/105795
* For r91123:Aaron Schulz2011-09-071-1/+1
| | | | | | | | | | | * Moved generateReason() to WikiPage. This fixes the PureWikiDeletion ext too. * Make Checkpoint ext call getRawText() as doEdit() does. Aalso, WikiPage doesn't have fetchContent(). * Call getAutosummary() statically in doEdit(). * Fixed outdated code comment. * Fixed title used in unit test. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96460
* rv r96424, Roan had his funChad Horohoe2011-09-071-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96428
* Break some tests intentionally to see how Jenkins displays thatRoan Kattouw2011-09-071-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96424
* It is stupid to test that a void method returns null. Add a comment ↵Platonides2011-07-231-3/+6
| | | | | | | | | | explaining that what we are testing is actually the function existence (see r91123 summary) Change the onArticle* to is_callable()s, so that a db is not needed. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92962
* Follow-up r91997, moved newFromTitle() function to WikiPage.php and renamed ↵Aaron Schulz2011-07-121-3/+3
| | | | | | | to factory(). This avoids an extra class. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/92002
* Added WikiPageFactory class with newFromTitle() functionAaron Schulz2011-07-121-0/+13
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91980
* split tests for ArticleTestAntoine Musso2011-07-031-19/+51
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91376
* * Split off WikiPage class from Article, WikiFilePage class from ImagePage, ↵Aaron Schulz2011-06-291-0/+34
and WikiCategoryPage from CategoryPage. * WikiPage functions/fields are "magically" part of Article when accessed for b/c. Magic is kind of ugly but there are too many callers to make breaking changes atm. Some functions are just wrappers for WikiPage ones (were magic won't work). * Added newFromID() to each WikiPage subclass (works around pre-existing inheritance problem). * Added Page class for convenient type hinting and changed hints from Article -> Page. This lets things use WikiPage objects without getting type errors. * Updated FlaggedPage to extend WikiPage. Worked around getOldIdFromRequest(). * Added setTimestamp() to WikiPage and moved some timestamp setting code from ParserCache to Article. * Removed ampersands from $dbw arguments. * @TODO: dependency inject user objects for WikiPage The idea is to migrate things to use WikiPage, as the run-of-the-mill "new Article()" call doesn't care about $oldid and $wgRequest. After that, Article, ImagePage, and CategoryPage can be rewritten as an Action class or something sane (a Viewer class of sorts). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91123