Type hint against LinkTarget in WatchedItemStore
[lhc/web/wiklou.git] / tests / phpunit / includes / page / ArticleTest.php
1 <?php
2
3 class ArticleTest extends MediaWikiTestCase {
4
5 /**
6 * @var Title
7 */
8 private $title;
9 /**
10 * @var Article
11 */
12 private $article;
13
14 /** creates a title object and its article object */
15 protected function setUp() {
16 parent::setUp();
17 $this->title = Title::makeTitle( NS_MAIN, 'SomePage' );
18 $this->article = new Article( $this->title );
19 }
20
21 /** cleanup title object and its article object */
22 protected function tearDown() {
23 parent::tearDown();
24 $this->title = null;
25 $this->article = null;
26 }
27
28 /**
29 * @covers Article::__get
30 */
31 public function testImplementsGetMagic() {
32 $this->assertEquals( false, $this->article->mLatest, "Article __get magic" );
33 }
34
35 /**
36 * @depends testImplementsGetMagic
37 * @covers Article::__set
38 */
39 public function testImplementsSetMagic() {
40 $this->article->mLatest = 2;
41 $this->assertEquals( 2, $this->article->mLatest, "Article __set magic" );
42 }
43
44 /**
45 * @covers Article::__get
46 * @covers Article::__set
47 */
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 }