summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/ArticleTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /tests/phpunit/includes/ArticleTest.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'tests/phpunit/includes/ArticleTest.php')
-rw-r--r--tests/phpunit/includes/ArticleTest.php82
1 files changed, 0 insertions, 82 deletions
diff --git a/tests/phpunit/includes/ArticleTest.php b/tests/phpunit/includes/ArticleTest.php
deleted file mode 100644
index 846d2b86..00000000
--- a/tests/phpunit/includes/ArticleTest.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-
-class ArticleTest extends MediaWikiTestCase {
-
- private $title; // holds a Title object
- private $article; // holds an article
-
- /** creates a title object and its article object */
- function setUp() {
- $this->title = Title::makeTitle( NS_MAIN, 'SomePage' );
- $this->article = new Article( $this->title );
-
- }
-
- /** cleanup title object and its article object */
- function tearDown() {
- $this->title = null;
- $this->article = null;
-
- }
-
- function testImplementsGetMagic() {
- $this->assertEquals( false, $this->article->mLatest, "Article __get magic" );
- }
-
- /**
- * @depends testImplementsGetMagic
- */
- function testImplementsSetMagic() {
- $this->article->mLatest = 2;
- $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" );
- }
-
- /**
- * @depends testImplementsSetMagic
- */
- function testImplementsCallMagic() {
- $this->article->mLatest = 33;
- $this->article->mDataLoaded = true;
- $this->assertEquals( 33, $this->article->getLatest(), "Article __call magic" );
- }
-
- function testGetOrSetOnNewProperty() {
- $this->article->ext_someNewProperty = 12;
- $this->assertEquals( 12, $this->article->ext_someNewProperty,
- "Article get/set magic on new field" );
-
- $this->article->ext_someNewProperty = -8;
- $this->assertEquals( -8, $this->article->ext_someNewProperty,
- "Article get/set magic on update to new field" );
- }
-
- /**
- * Checks for the existence of the backwards compatibility static functions (forwarders to WikiPage class)
- */
- function testStaticFunctions() {
- $this->assertEquals( WikiPage::selectFields(), Article::selectFields(),
- "Article static functions" );
- $this->assertEquals( true, is_callable( "Article::onArticleCreate" ),
- "Article static functions" );
- $this->assertEquals( true, is_callable( "Article::onArticleDelete" ),
- "Article static functions" );
- $this->assertEquals( true, is_callable( "ImagePage::onArticleEdit" ),
- "Article static functions" );
- $this->assertTrue( is_string( CategoryPage::getAutosummary( '', '', 0 ) ),
- "Article static functions" );
- }
-
- function testWikiPageFactory() {
- $title = Title::makeTitle( NS_FILE, 'Someimage.png' );
- $page = WikiPage::factory( $title );
- $this->assertEquals( 'WikiFilePage', get_class( $page ) );
-
- $title = Title::makeTitle( NS_CATEGORY, 'SomeCategory' );
- $page = WikiPage::factory( $title );
- $this->assertEquals( 'WikiCategoryPage', get_class( $page ) );
-
- $title = Title::makeTitle( NS_MAIN, 'SomePage' );
- $page = WikiPage::factory( $title );
- $this->assertEquals( 'WikiPage', get_class( $page ) );
- }
-}