MediaWiki REL1_32
ArticleTest.php
Go to the documentation of this file.
1<?php
2
4
8 private $title;
12 private $article;
13
15 protected function setUp() {
16 parent::setUp();
17 $this->title = Title::makeTitle( NS_MAIN, 'SomePage' );
18 $this->article = new Article( $this->title );
19 }
20
22 protected function tearDown() {
23 parent::tearDown();
24 $this->title = null;
25 $this->article = null;
26 }
27
31 public function testImplementsGetMagic() {
32 $this->assertEquals( false, $this->article->mLatest, "Article __get magic" );
33 }
34
39 public function testImplementsSetMagic() {
40 $this->article->mLatest = 2;
41 $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" );
42 }
43
48 public function testGetOrSetOnNewProperty() {
49 $this->article->ext_someNewProperty = 12;
50 $this->assertEquals( 12, $this->article->ext_someNewProperty,
51 "Article get/set magic on new field" );
52
53 $this->article->ext_someNewProperty = -8;
54 $this->assertEquals( -8, $this->article->ext_someNewProperty,
55 "Article get/set magic on update to new field" );
56 }
57}
testImplementsSetMagic()
@depends testImplementsGetMagic Article::__set
tearDown()
cleanup title object and its article object
Article $article
setUp()
creates a title object and its article object
testGetOrSetOnNewProperty()
Article::__get Article::__set.
testImplementsGetMagic()
Article::__get.
Class for viewing MediaWiki article and history.
Definition Article.php:38
Represents a title within MediaWiki.
Definition Title.php:39
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of or an object and a method hook function The function part of a third party developers and local administrators to define code that will be run at certain points in the mainline and to modify the data run by that mainline code Hooks can keep mainline code and make it easier to write extensions Hooks are a principled alternative to local patches for two options in MediaWiki One reverses the order of a title before displaying the article
Definition hooks.txt:33
const NS_MAIN
Definition Defines.php:64