Index: trunk/extensions/PageTriage/tests/phpunit/SpecialPageTriageTest.php |
— | — | @@ -0,0 +1,33 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Tests for SpecialPageTriage class (PageTriage list view) |
| 5 | + * |
| 6 | + * @group EditorEngagement |
| 7 | + * @author Ryan Kaldari |
| 8 | + */ |
| 9 | +class SpecialPageTriageTest extends PHPUnit_Framework_TestCase { |
| 10 | + |
| 11 | + protected $pageTriage; |
| 12 | + |
| 13 | + protected function setUp() { |
| 14 | + parent::setUp(); |
| 15 | + $this->pageTriage = new SpecialPageTriage; |
| 16 | + |
| 17 | + // Insert some made up articles into the database |
| 18 | + } |
| 19 | + |
| 20 | + protected function tearDown() { |
| 21 | + parent::tearDown(); |
| 22 | + |
| 23 | + // Remove the made up articles |
| 24 | + } |
| 25 | + |
| 26 | + // This is a sample test (not actually very useful) |
| 27 | + public function testGetTriageHeader() { |
| 28 | + $this->assertEquals( |
| 29 | + '<p>Page Triage Header goes here</p>', |
| 30 | + $this->pageTriage->getTriageHeader() |
| 31 | + ); |
| 32 | + } |
| 33 | + |
| 34 | +} |
Property changes on: trunk/extensions/PageTriage/tests/phpunit/SpecialPageTriageTest.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 35 | + native |
Index: trunk/extensions/PageTriage/PageTriage.php |
— | — | @@ -43,6 +43,10 @@ |
44 | 44 | 'descriptionmsg' => 'pagetriage-desc', |
45 | 45 | ); |
46 | 46 | |
| 47 | +// Begin configuration variables |
| 48 | +$wgPageTriagePageIdPerRequest = 20; |
| 49 | +// End configuration variables |
| 50 | + |
47 | 51 | $dir = dirname( __FILE__ ) . '/'; |
48 | 52 | |
49 | 53 | $wgExtensionMessagesFiles['PageTriage'] = $dir . 'PageTriage.i18n.php'; |
— | — | @@ -73,6 +77,7 @@ |
74 | 78 | $wgHooks['NewRevisionFromEditComplete'][] = 'PageTriageHooks::onNewRevisionFromEditComplete'; |
75 | 79 | $wgHooks['ArticleInsertComplete'][] = 'PageTriageHooks::onArticleInsertComplete'; |
76 | 80 | $wgHooks['ArticleSaveComplete'][] = 'PageTriageHooks::onArticleSaveComplete'; |
| 81 | +$wgHooks['UnitTestsList'][] = 'efPageTriageUnitTests'; // unit tests |
77 | 82 | |
78 | 83 | /** |
79 | 84 | * @param $updater DatabaseUpdater |
— | — | @@ -98,7 +103,16 @@ |
99 | 104 | return true; |
100 | 105 | } |
101 | 106 | |
102 | | -$wgPageTriagePageIdPerRequest = 20; |
| 107 | +/** |
| 108 | + * UnitTestsList hook handler - adds unit test files to the unit tester |
| 109 | + * @param $files array |
| 110 | + * @return bool |
| 111 | + */ |
| 112 | +function efPageTriageUnitTests( &$files ) { |
| 113 | + $base = dirname( __FILE__ ) . '/tests'; |
| 114 | + $files[] = $base . '/phpunit/SpecialPageTriageTest.php'; |
| 115 | + return true; |
| 116 | +} |
103 | 117 | |
104 | 118 | // Register ResourceLoader modules |
105 | 119 | $wgResourceModules['ext.pageTriage.core'] = array( |