It is stupid to test that a void method returns null. Add a comment explaining that
authorPlatonides <platonides@users.mediawiki.org>
Sat, 23 Jul 2011 20:23:26 +0000 (20:23 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sat, 23 Jul 2011 20:23:26 +0000 (20:23 +0000)
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.

tests/phpunit/includes/ArticleTest.php

index 18c970d..56384cf 100644 (file)
@@ -50,14 +50,17 @@ class ArticleTest extends MediaWikiTestCase {
                        "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( null, Article::onArticleCreate( $this->title ),
+               $this->assertEquals( true, is_callable( "Article::onArticleCreate" ),
                        "Article static functions" );
-               $this->assertEquals( null, Article::onArticleDelete( $this->title ),
+               $this->assertEquals( true, is_callable( "Article::onArticleDelete" ),
                        "Article static functions" );
-               $this->assertEquals( null, ImagePage::onArticleEdit( $this->title ),
+               $this->assertEquals( true, is_callable( "ImagePage::onArticleEdit" ),
                        "Article static functions" );
                $this->assertTrue( is_string( CategoryPage::getAutosummary( '', '', 0 ) ),
                        "Article static functions" );