Introduce basic SpecialWatchlistTest
authoraddshore <addshorewiki@gmail.com>
Thu, 24 Mar 2016 13:11:07 +0000 (13:11 +0000)
committeraddshore <addshorewiki@gmail.com>
Thu, 24 Mar 2016 13:19:30 +0000 (13:19 +0000)
Change-Id: I98a2ad112189a09581a0564da3c3357939a5d7de

tests/phpunit/includes/specials/SpecialWatchlistTest.php [new file with mode: 0644]

diff --git a/tests/phpunit/includes/specials/SpecialWatchlistTest.php b/tests/phpunit/includes/specials/SpecialWatchlistTest.php
new file mode 100644 (file)
index 0000000..6e702b6
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @author Addshore
+ *
+ * @group Database
+ *
+ * @covers SpecialWatchlist
+ */
+class SpecialWatchlistTest extends SpecialPageTestBase {
+
+       /**
+        * Returns a new instance of the special page under test.
+        *
+        * @return SpecialPage
+        */
+       protected function newSpecialPage() {
+               return new SpecialWatchlist();
+       }
+
+       public function testNotLoggedIn_throwsException() {
+               $this->setExpectedException( 'UserNotLoggedIn' );
+               $this->executeSpecialPage();
+       }
+
+       public function testUserWithNoWatchedItems_displaysNoWatchlistMessage() {
+               $user = new TestUser( __METHOD__ );
+               list( $html, ) = $this->executeSpecialPage( '', null, 'qqx', $user->getUser() );
+               $this->assertContains( '(nowatchlist)', $html );
+       }
+
+}