class ArticleTest extends MediaWikiTestCase {
- private $title; // holds a Title object
- private $article; // holds an article
+ /**
+ * @var Title
+ */
+ private $title;
+ /**
+ * @var Article
+ */
+ private $article;
/** creates a title object and its article object */
- function setUp() {
- $this->title = Title::makeTitle( NS_MAIN, 'SomePage' );
+ protected 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;
+ protected function tearDown() {
+ $this->title = null;
$this->article = null;
}
- 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() {
* Checks for the existence of the backwards compatibility static functions (forwarders to WikiPage class)
*/
function testStaticFunctions() {
+ $this->hideDeprecated( 'Article::getAutosummary' );
+ $this->hideDeprecated( 'WikiPage::getAutosummary' );
+
$this->assertEquals( WikiPage::selectFields(), Article::selectFields(),
"Article static functions" );
$this->assertEquals( true, is_callable( "Article::onArticleCreate" ),