MediaWiki  master
ApiQueryWatchlistIntegrationTest Class Reference

medium API Database More...

Inheritance diagram for ApiQueryWatchlistIntegrationTest:
Collaboration diagram for ApiQueryWatchlistIntegrationTest:

Public Member Functions

 __construct ( $name=null, array $data=[], $dataName='')
 
 testAllRevParam ()
 
 testCategorizeTypeParameter ()
 
 testCommentPropParameter ()
 
 testContinueParam ()
 
 testDirParams ()
 
 testEmptyPropParameter ()
 
 testExcludeUserParam ()
 
 testExternalTypeParameters ()
 
 testFlagsPropParameter ()
 
 testGeneratorWatchlistPropInfo_returnsWatchedPages ()
 
 testGeneratorWatchlistPropRevisions_returnsWatchedItemsRevisions ()
 
 testIdsPropParameter ()
 
 testLimitParam ()
 
 testListWatchlist_returnsWatchedItemsWithRCInfo ()
 
 testLoginfoPropParameter ()
 
 testLogTypeParameters ()
 
 testNamespaceParam ()
 
 testNewAndEditTypeParameters ()
 
 testNotificationTimestampPropParameter ()
 
 testOwnerAndTokenParams ()
 
 testOwnerAndTokenParams_noWatchlistTokenSet ()
 
 testOwnerAndTokenParams_wrongToken ()
 
 testParsedCommentPropParameter ()
 
 testPatrolPropParameter ()
 
 testShowAnonParams ()
 
 testShowBotParams ()
 
 testShowMinorParams ()
 
 testShowPatrolledParams ()
 
 testShowUnreadParams ()
 
 testSizesPropParameter ()
 
 testStartEndParams ()
 
 testTimestampPropParameter ()
 
 testTitlePropParameter ()
 
 testUserIdPropParameter ()
 
 testUserParam ()
 
 testUserPropParameter ()
 
- Public Member Functions inherited from ApiTestCase
 testApiTestGroup ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from ApiTestCase
 doApiRequest (array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
 Does the API request and returns the result. More...
 
 doApiRequestWithToken (array $params, array $session=null, User $user=null, $tokenType='auto')
 Convenience function to access the token parameter of doApiRequest() more succinctly. More...
 
 doLogin ( $testUser=null)
 Previously this would do API requests to log in, as well as setting $wgUser and the request context's user. More...
 
 getTokenList (TestUser $user, $session=null)
 
 setExpectedApiException ( $msg, $code=null, array $data=null, $httpCode=0)
 Expect an ApiUsageException to be thrown with the given parameters, which are the same as ApiUsageException::newWithMessage()'s parameters. More...
 
 setUp ()
 
 tearDown ()
 
- Protected Member Functions inherited from MediaWikiLangTestCase
 setUp ()
 

Private Member Functions

 assertArraySubsetsEqual (array $actualItems, array $expectedItems, array $keysUsedInValueComparison, array $requiredKeys=[])
 Convenience method to assert that actual items array fetched from API is equal to the expected array, Unlike assertEquals this only checks if values of specified keys are equal in both arrays. More...
 
 cleanTestUsersWatchlist ()
 
 createPageAndDeleteIt (LinkTarget $target)
 
 deletePage (LinkTarget $target, $reason)
 
 doAnonPageEdit (LinkTarget $target, $content, $summary)
 
 doBotPageEdit (User $user, LinkTarget $target, $content, $summary)
 
 doGeneratorWatchlistRequest (array $params=[])
 
 doListWatchlistRequest (array $params=[], $user=null)
 
 doMinorPageEdit (User $user, LinkTarget $target, $content, $summary)
 
 doPageEdit (User $user, LinkTarget $target, $content, $summary)
 
 doPageEdits (User $user, array $editData)
 Performs a batch of page edits as a specified user. More...
 
 doPatrolledPageEdit (User $user, LinkTarget $target, $content, $summary, User $patrollingUser)
 
 getExternalRC (LinkTarget $target)
 
 getItemsFromApiResponse (array $response)
 
 getLoggedInTestUser ()
 
 getNonLoggedInTestUser ()
 
 getPrefixedText (LinkTarget $target)
 
 getWatchedItemStore ()
 
 setupPatrolledSpecificFixtures (User $user)
 
 watchPages (User $user, array $targets)
 

Additional Inherited Members

- Static Public Member Functions inherited from ApiTestCase
static apiExceptionHasCode (ApiUsageException $ex, $code)
 
- Static Protected Member Functions inherited from ApiTestCase
static getErrorFormatter ()
 
- Protected Attributes inherited from ApiTestCase
ApiTestContext $apiContext
 
- Static Protected Attributes inherited from ApiTestCase
static $apiUrl
 
static $errorFormatter = null
 

Detailed Description

medium API Database

ApiQueryWatchlist

Definition at line 14 of file ApiQueryWatchlistIntegrationTest.php.

Constructor & Destructor Documentation

◆ __construct()

ApiQueryWatchlistIntegrationTest::__construct (   $name = null,
array  $data = [],
  $dataName = '' 
)

Definition at line 16 of file ApiQueryWatchlistIntegrationTest.php.

References $name.

Member Function Documentation

◆ assertArraySubsetsEqual()

ApiQueryWatchlistIntegrationTest::assertArraySubsetsEqual ( array  $actualItems,
array  $expectedItems,
array  $keysUsedInValueComparison,
array  $requiredKeys = [] 
)
private

Convenience method to assert that actual items array fetched from API is equal to the expected array, Unlike assertEquals this only checks if values of specified keys are equal in both arrays.

This could be used e.g. not to compare IDs that could change between test run but only stable keys. Optionally this also checks that specified keys are present in the actual item without performing any checks on the related values.

Parameters
array$actualItemsarray of actual items (associative arrays)
array$expectedItemsarray of expected items (associative arrays), those items have less keys than actual items
array$keysUsedInValueComparisonlist of keys of the actual item that will be used in the comparison of values
array$requiredKeysoptional, list of keys that must be present in the actual items. Values of those keys are not checked.

Definition at line 203 of file ApiQueryWatchlistIntegrationTest.php.

References as, and use.

Referenced by testGeneratorWatchlistPropInfo_returnsWatchedPages(), testGeneratorWatchlistPropRevisions_returnsWatchedItemsRevisions(), testListWatchlist_returnsWatchedItemsWithRCInfo(), testLoginfoPropParameter(), testNamespaceParam(), testShowAnonParams(), testShowBotParams(), and testShowMinorParams().

◆ cleanTestUsersWatchlist()

ApiQueryWatchlistIntegrationTest::cleanTestUsersWatchlist ( )
private

◆ createPageAndDeleteIt()

ApiQueryWatchlistIntegrationTest::createPageAndDeleteIt ( LinkTarget  $target)
private

◆ deletePage()

ApiQueryWatchlistIntegrationTest::deletePage ( LinkTarget  $target,
  $reason 
)
private

◆ doAnonPageEdit()

ApiQueryWatchlistIntegrationTest::doAnonPageEdit ( LinkTarget  $target,
  $content,
  $summary 
)
private

◆ doBotPageEdit()

ApiQueryWatchlistIntegrationTest::doBotPageEdit ( User  $user,
LinkTarget  $target,
  $content,
  $summary 
)
private

◆ doGeneratorWatchlistRequest()

ApiQueryWatchlistIntegrationTest::doGeneratorWatchlistRequest ( array  $params = [])
private

◆ doListWatchlistRequest()

◆ doMinorPageEdit()

ApiQueryWatchlistIntegrationTest::doMinorPageEdit ( User  $user,
LinkTarget  $target,
  $content,
  $summary 
)
private

◆ doPageEdit()

◆ doPageEdits()

ApiQueryWatchlistIntegrationTest::doPageEdits ( User  $user,
array  $editData 
)
private

Performs a batch of page edits as a specified user.

Parameters
User$user
array$editDataassociative array, keys:
  • target => LinkTarget page to edit
  • content => string new content
  • summary => string edit summary
  • minorEdit => bool mark as minor edit if true (defaults to false)
  • botEdit => bool mark as bot edit if true (defaults to false)

Definition at line 120 of file ApiQueryWatchlistIntegrationTest.php.

References as, doBotPageEdit(), doMinorPageEdit(), and doPageEdit().

Referenced by testAllRevParam(), testCategorizeTypeParameter(), testContinueParam(), testDirParams(), testFlagsPropParameter(), testGeneratorWatchlistPropRevisions_returnsWatchedItemsRevisions(), testLimitParam(), testNamespaceParam(), testNewAndEditTypeParameters(), testShowMinorParams(), and testTitlePropParameter().

◆ doPatrolledPageEdit()

ApiQueryWatchlistIntegrationTest::doPatrolledPageEdit ( User  $user,
LinkTarget  $target,
  $content,
  $summary,
User  $patrollingUser 
)
private

◆ getExternalRC()

ApiQueryWatchlistIntegrationTest::getExternalRC ( LinkTarget  $target)
private

◆ getItemsFromApiResponse()

◆ getLoggedInTestUser()

◆ getNonLoggedInTestUser()

◆ getPrefixedText()

◆ getWatchedItemStore()

ApiQueryWatchlistIntegrationTest::getWatchedItemStore ( )
private

◆ setUp()

ApiQueryWatchlistIntegrationTest::setUp ( )
protected

Definition at line 23 of file ApiQueryWatchlistIntegrationTest.php.

◆ setupPatrolledSpecificFixtures()

ApiQueryWatchlistIntegrationTest::setupPatrolledSpecificFixtures ( User  $user)
private

◆ testAllRevParam()

ApiQueryWatchlistIntegrationTest::testAllRevParam ( )

◆ testCategorizeTypeParameter()

◆ testCommentPropParameter()

ApiQueryWatchlistIntegrationTest::testCommentPropParameter ( )

◆ testContinueParam()

ApiQueryWatchlistIntegrationTest::testContinueParam ( )

◆ testDirParams()

ApiQueryWatchlistIntegrationTest::testDirParams ( )

◆ testEmptyPropParameter()

ApiQueryWatchlistIntegrationTest::testEmptyPropParameter ( )

◆ testExcludeUserParam()

ApiQueryWatchlistIntegrationTest::testExcludeUserParam ( )

◆ testExternalTypeParameters()

ApiQueryWatchlistIntegrationTest::testExternalTypeParameters ( )

◆ testFlagsPropParameter()

ApiQueryWatchlistIntegrationTest::testFlagsPropParameter ( )

◆ testGeneratorWatchlistPropInfo_returnsWatchedPages()

ApiQueryWatchlistIntegrationTest::testGeneratorWatchlistPropInfo_returnsWatchedPages ( )

◆ testGeneratorWatchlistPropRevisions_returnsWatchedItemsRevisions()

ApiQueryWatchlistIntegrationTest::testGeneratorWatchlistPropRevisions_returnsWatchedItemsRevisions ( )

◆ testIdsPropParameter()

ApiQueryWatchlistIntegrationTest::testIdsPropParameter ( )

◆ testLimitParam()

ApiQueryWatchlistIntegrationTest::testLimitParam ( )

◆ testListWatchlist_returnsWatchedItemsWithRCInfo()

ApiQueryWatchlistIntegrationTest::testListWatchlist_returnsWatchedItemsWithRCInfo ( )

◆ testLoginfoPropParameter()

ApiQueryWatchlistIntegrationTest::testLoginfoPropParameter ( )

◆ testLogTypeParameters()

ApiQueryWatchlistIntegrationTest::testLogTypeParameters ( )

◆ testNamespaceParam()

◆ testNewAndEditTypeParameters()

ApiQueryWatchlistIntegrationTest::testNewAndEditTypeParameters ( )

◆ testNotificationTimestampPropParameter()

ApiQueryWatchlistIntegrationTest::testNotificationTimestampPropParameter ( )

◆ testOwnerAndTokenParams()

◆ testOwnerAndTokenParams_noWatchlistTokenSet()

ApiQueryWatchlistIntegrationTest::testOwnerAndTokenParams_noWatchlistTokenSet ( )

◆ testOwnerAndTokenParams_wrongToken()

ApiQueryWatchlistIntegrationTest::testOwnerAndTokenParams_wrongToken ( )

◆ testParsedCommentPropParameter()

ApiQueryWatchlistIntegrationTest::testParsedCommentPropParameter ( )

◆ testPatrolPropParameter()

ApiQueryWatchlistIntegrationTest::testPatrolPropParameter ( )

◆ testShowAnonParams()

◆ testShowBotParams()

◆ testShowMinorParams()

◆ testShowPatrolledParams()

◆ testShowUnreadParams()

◆ testSizesPropParameter()

ApiQueryWatchlistIntegrationTest::testSizesPropParameter ( )

◆ testStartEndParams()

ApiQueryWatchlistIntegrationTest::testStartEndParams ( )

◆ testTimestampPropParameter()

ApiQueryWatchlistIntegrationTest::testTimestampPropParameter ( )

◆ testTitlePropParameter()

ApiQueryWatchlistIntegrationTest::testTitlePropParameter ( )

◆ testUserIdPropParameter()

ApiQueryWatchlistIntegrationTest::testUserIdPropParameter ( )

◆ testUserParam()

◆ testUserPropParameter()

ApiQueryWatchlistIntegrationTest::testUserPropParameter ( )

◆ watchPages()


The documentation for this class was generated from the following file: