2 use MediaWiki\MediaWikiServices
;
6 * @covers ApiSetNotificationTimestamp
11 class ApiSetNotificationTimestampIntegrationTest
extends ApiTestCase
{
13 protected function setUp() {
15 self
::$users[__CLASS__
] = new TestUser( __CLASS__
);
16 $this->doLogin( __CLASS__
);
19 public function testStuff() {
20 $user = self
::$users[__CLASS__
]->getUser();
21 $page = WikiPage
::factory( Title
::newFromText( 'UTPage' ) );
23 $user->addWatch( $page->getTitle() );
25 $result = $this->doApiRequestWithToken(
27 'action' => 'setnotificationtimestamp',
28 'timestamp' => '20160101020202',
29 'pageids' => $page->getId(),
37 'batchcomplete' => true,
38 'setnotificationtimestamp' => [
39 [ 'ns' => 0, 'title' => 'UTPage', 'notificationtimestamp' => '2016-01-01T02:02:02Z' ]
45 $watchedItemStore = MediaWikiServices
::getInstance()->getWatchedItemStore();
47 $watchedItemStore->getNotificationTimestampsBatch( $user, [ $page->getTitle() ] ),
48 [ [ 'UTPage' => '20160101020202' ] ]