From: Platonides Date: Sat, 23 Jul 2011 20:23:26 +0000 (+0000) Subject: It is stupid to test that a void method returns null. Add a comment explaining that X-Git-Tag: 1.31.0-rc.0~28662 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=905caba37de33e45bb3221dac602778749bd9f67;p=lhc%2Fweb%2Fwiklou.git It is stupid to test that a void method returns null. Add a comment 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. --- diff --git a/tests/phpunit/includes/ArticleTest.php b/tests/phpunit/includes/ArticleTest.php index 18c970d2c1..56384cff6a 100644 --- a/tests/phpunit/includes/ArticleTest.php +++ b/tests/phpunit/includes/ArticleTest.php @@ -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" );