Merge "Remove use of BagOStuff TTL constants from unrelated code"
[mediawiki.git] / tests / phpunit / includes / api / query / ApiQueryLogEventsTest.php
blob6980993da523bc69da142d94bfb431af38acaf98
1 <?php
3 namespace MediaWiki\Tests\Api\Query;
5 use MediaWiki\Permissions\UltimateAuthority;
6 use MediaWiki\Tests\Api\ApiTestCase;
7 use MediaWiki\Tests\User\TempUser\TempUserTestTrait;
8 use MediaWiki\User\UserIdentityValue;
10 /**
11 * @covers \MediaWiki\Api\ApiQueryLogEvents
12 * @group API
13 * @group Database
14 * @group medium
16 class ApiQueryLogEventsTest extends ApiTestCase {
17 use TempUserTestTrait;
19 /**
20 * @group Database
22 public function testLogEventByTempUser() {
23 $this->enableAutoCreateTempUser();
24 $tempUser = new UserIdentityValue( 1236764321, '~1' );
25 $title = $this->getNonexistingTestPage( 'TestPage1' )->getTitle();
26 $this->editPage(
27 $title,
28 'Some Content',
29 'Create Page',
30 NS_MAIN,
31 new UltimateAuthority( $tempUser )
34 [ $result, ] = $this->doApiRequest( [
35 'action' => 'query',
36 'list' => 'logevents',
37 ] );
38 $this->assertArrayHasKey( 'temp', $result[ 'query' ][ 'logevents' ][0] );
39 $this->assertTrue( $result[ 'query' ][ 'logevents' ][0]['temp'] );