Merge "User: Avoid deprecated Linker::link()"
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiQueryWatchlistIntegrationTest.php
index eaeb3ae..4f4453f 100644 (file)
@@ -210,7 +210,7 @@ class ApiQueryWatchlistIntegrationTest extends ApiTestCase {
 
                // not checking values of all keys of the actual item, so removing unwanted keys from comparison
                $actualItemsOnlyComparedValues = array_map(
-                       function( array $item ) use ( $keysUsedInValueComparison ) {
+                       function ( array $item ) use ( $keysUsedInValueComparison ) {
                                return array_intersect_key( $item, array_flip( $keysUsedInValueComparison ) );
                        },
                        $actualItems
@@ -1475,6 +1475,9 @@ class ApiQueryWatchlistIntegrationTest extends ApiTestCase {
 
                $this->watchPages( $otherUser, [ $target ] );
 
+               $reloadedUser = User::newFromName( $otherUser->getName() );
+               $this->assertEquals( '1234567890', $reloadedUser->getOption( 'watchlisttoken' ) );
+
                $result = $this->doListWatchlistRequest( [
                        'wlowner' => $otherUser->getName(),
                        'wltoken' => '1234567890',
@@ -1498,7 +1501,7 @@ class ApiQueryWatchlistIntegrationTest 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->doListWatchlistRequest( [
                        'wlowner' => $otherUser->getName(),
@@ -1507,7 +1510,7 @@ class ApiQueryWatchlistIntegrationTest extends ApiTestCase {
        }
 
        public function testOwnerAndTokenParams_noWatchlistTokenSet() {
-               $this->setExpectedException( UsageException::class, 'Incorrect watchlist token provided' );
+               $this->setExpectedException( ApiUsageException::class, 'Incorrect watchlist token provided' );
 
                $this->doListWatchlistRequest( [
                        'wlowner' => $this->getNonLoggedInTestUser()->getName(),