r104036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104035‎ | r104036 | r104037 >
Date:14:24, 23 November 2011
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
FlaggedPageTest -> FlaggablePageTest

Follow up r99295
Modified paths:
  • /trunk/extensions/FlaggedRevs/tests/FlaggablePageTest.php (added) (history)
  • /trunk/extensions/FlaggedRevs/tests/FlaggedPageTest.php (deleted) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/tests/FlaggedPageTest.php
@@ -1,42 +0,0 @@
2 -<?php
3 -
4 -class FlaggedPageTest extends PHPUnit_Framework_TestCase {
5 - /**
6 - * Prepares the environment before running a test.
7 - */
8 - protected function setUp() {
9 - parent::setUp();
10 - $this->user = new User();
11 - }
12 -
13 - /**
14 - * Cleans up the environment after running a test.
15 - */
16 - protected function tearDown() {
17 - parent::tearDown();
18 - }
19 -
20 - /**
21 - * Constructs the test case.
22 - */
23 - public function __construct() {}
24 -
25 - public function testPageDataFromTitle() {
26 - $title = Title::makeTitle( NS_MAIN, "somePage" );
27 - $article = new FlaggableWikiPage( $title );
28 -
29 - $user = $this->user;
30 - $article->doEdit( "Some text to insert", "creating a page", EDIT_NEW, false, $user );
31 -
32 - $data = (array)$article->pageDataFromTitle( wfGetDB( DB_SLAVE ), $title );
33 -
34 - $this->assertEquals( true, array_key_exists( 'fpc_override', $data ),
35 - "data->fpc_override field exists" );
36 - $this->assertEquals( true, array_key_exists( 'fp_stable', $data ),
37 - "data->fp_stable field exists" );
38 - $this->assertEquals( true, array_key_exists( 'fp_pending_since', $data ),
39 - "data->fp_pending_since field exists" );
40 - $this->assertEquals( true, array_key_exists( 'fp_reviewed', $data ),
41 - "data->fp_reviewed field exists" );
42 - }
43 -}
Index: trunk/extensions/FlaggedRevs/tests/FlaggablePageTest.php
@@ -0,0 +1,42 @@
 2+<?php
 3+
 4+class FlaggablePageTest extends PHPUnit_Framework_TestCase {
 5+ /**
 6+ * Prepares the environment before running a test.
 7+ */
 8+ protected function setUp() {
 9+ parent::setUp();
 10+ $this->user = new User();
 11+ }
 12+
 13+ /**
 14+ * Cleans up the environment after running a test.
 15+ */
 16+ protected function tearDown() {
 17+ parent::tearDown();
 18+ }
 19+
 20+ /**
 21+ * Constructs the test case.
 22+ */
 23+ public function __construct() {}
 24+
 25+ public function testPageDataFromTitle() {
 26+ $title = Title::makeTitle( NS_MAIN, "somePage" );
 27+ $article = new FlaggableWikiPage( $title );
 28+
 29+ $user = $this->user;
 30+ $article->doEdit( "Some text to insert", "creating a page", EDIT_NEW, false, $user );
 31+
 32+ $data = (array)$article->pageDataFromTitle( wfGetDB( DB_SLAVE ), $title );
 33+
 34+ $this->assertEquals( true, array_key_exists( 'fpc_override', $data ),
 35+ "data->fpc_override field exists" );
 36+ $this->assertEquals( true, array_key_exists( 'fp_stable', $data ),
 37+ "data->fp_stable field exists" );
 38+ $this->assertEquals( true, array_key_exists( 'fp_pending_since', $data ),
 39+ "data->fp_pending_since field exists" );
 40+ $this->assertEquals( true, array_key_exists( 'fp_reviewed', $data ),
 41+ "data->fp_reviewed field exists" );
 42+ }
 43+}
Property changes on: trunk/extensions/FlaggedRevs/tests/FlaggablePageTest.php
___________________________________________________________________
Added: svn:eol-style
144 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r104562also rename filename in hooks file (ping r104036)hashar14:20, 29 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99295Renamed classes to avoid implication that the page *is* flagged:...aaron02:39, 8 October 2011

Comments

#Comment by Hashar (talk | contribs)   14:20, 29 November 2011

Resetting to new, I forgot to change the filename in the hook registration file (fix is r104562).

Status & tagging log