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
;
11 * @covers \MediaWiki\Api\ApiQueryLogEvents
16 class ApiQueryLogEventsTest
extends ApiTestCase
{
17 use TempUserTestTrait
;
22 public function testLogEventByTempUser() {
23 $this->enableAutoCreateTempUser();
24 $tempUser = new UserIdentityValue( 1236764321, '~1' );
25 $title = $this->getNonexistingTestPage( 'TestPage1' )->getTitle();
31 new UltimateAuthority( $tempUser )
34 [ $result, ] = $this->doApiRequest( [
36 'list' => 'logevents',
38 $this->assertArrayHasKey( 'temp', $result[ 'query' ][ 'logevents' ][0] );
39 $this->assertTrue( $result[ 'query' ][ 'logevents' ][0]['temp'] );