Merge "Test ApiUserrights"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiQueryWatchlistRawIntegrationTest.php
index d6f315d..2af63c4 100644 (file)
@@ -17,7 +17,6 @@ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase {
                        = $this->getMutableTestUser();
                self::$users['ApiQueryWatchlistRawIntegrationTestUser2']
                        = $this->getMutableTestUser();
-               $this->doLogin( 'ApiQueryWatchlistRawIntegrationTestUser' );
        }
 
        private function getLoggedInTestUser() {
@@ -36,14 +35,14 @@ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase {
                return $this->doApiRequest( array_merge(
                        [ 'action' => 'query', 'list' => 'watchlistraw' ],
                        $params
-               ) );
+               ), null, false, $this->getLoggedInTestUser() );
        }
 
        private function doGeneratorWatchlistRawRequest( array $params = [] ) {
                return $this->doApiRequest( array_merge(
                        [ 'action' => 'query', 'generator' => 'watchlistraw' ],
                        $params
-               ) );
+               ), null, false, $this->getLoggedInTestUser() );
        }
 
        private function getItemsFromApiResponse( array $response ) {
@@ -503,7 +502,7 @@ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase {
                $otherUser->setOption( 'watchlisttoken', '1234567890' );
                $otherUser->saveSettings();
 
-               $this->setExpectedException( UsageException::class, 'Incorrect watchlist token provided' );
+               $this->setExpectedException( ApiUsageException::class, 'Incorrect watchlist token provided' );
 
                $this->doListWatchlistRawRequest( [
                        'wrowner' => $otherUser->getName(),
@@ -512,7 +511,7 @@ class ApiQueryWatchlistRawIntegrationTest extends ApiTestCase {
        }
 
        public function testOwnerAndTokenParams_userHasNoWatchlistToken() {
-               $this->setExpectedException( UsageException::class, 'Incorrect watchlist token provided' );
+               $this->setExpectedException( ApiUsageException::class, 'Incorrect watchlist token provided' );
 
                $this->doListWatchlistRawRequest( [
                        'wrowner' => $this->getNotLoggedInTestUser()->getName(),