/** creates a title object and its article object */
function setUp() {
- $this->title = Title::makeTitle( NS_MAIN, 'somePage' );
+ $this->title = Title::makeTitle( NS_MAIN, 'SomePage' );
$this->article = new Article( $this->title );
}
}
- function testImplementsGetMagic() {
- $this->assertEquals( -1, $this->article->mCounter, "Article __get magic" );
+ function testImplementsGetMagic() {
+ $this->assertEquals( false, $this->article->mLatest, "Article __get magic" );
}
/**
* @depends testImplementsGetMagic
*/
function testImplementsSetMagic() {
-
- $this->article->mCounter = 2;
- $this->assertEquals( 2, $this->article->mCounter, "Article __set magic" );
+ $this->article->mLatest = 2;
+ $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" );
}
/**
* @depends testImplementsSetMagic
*/
function testImplementsCallMagic() {
- $this->article->mCounter = 33;
- $this->assertEquals( 33, $this->article->getCount(), "Article __call magic" );
+ $this->article->mLatest = 33;
+ $this->article->mDataLoaded = true;
+ $this->assertEquals( 33, $this->article->getLatest(), "Article __call magic" );
}
function testGetOrSetOnNewProperty() {
"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" );
function testWikiPageFactory() {
$title = Title::makeTitle( NS_FILE, 'Someimage.png' );
- $page = WikiPageFactory::newFromTitle( $title );
+ $page = WikiPage::factory( $title );
$this->assertEquals( 'WikiFilePage', get_class( $page ) );
$title = Title::makeTitle( NS_CATEGORY, 'SomeCategory' );
- $page = WikiPageFactory::newFromTitle( $title );
+ $page = WikiPage::factory( $title );
$this->assertEquals( 'WikiCategoryPage', get_class( $page ) );
$title = Title::makeTitle( NS_MAIN, 'SomePage' );
- $page = WikiPageFactory::newFromTitle( $title );
+ $page = WikiPage::factory( $title );
$this->assertEquals( 'WikiPage', get_class( $page ) );
}
}