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