2020-08-11 20:34:21 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-22 15:31:00 +00:00
|
|
|
namespace MediaWiki\Extension\Notifications\Test\Integration\Push;
|
|
|
|
|
2022-04-08 00:38:27 +00:00
|
|
|
use MediaWiki\Extension\Notifications\Push\Utils;
|
2024-02-22 15:31:00 +00:00
|
|
|
use MediaWikiIntegrationTestCase;
|
2020-08-11 20:34:21 +00:00
|
|
|
|
2023-07-17 18:09:54 +00:00
|
|
|
/**
|
|
|
|
* @covers \MediaWiki\Extension\Notifications\Push\Utils
|
|
|
|
* @group Database
|
|
|
|
*/
|
2020-08-11 20:34:21 +00:00
|
|
|
class UtilsTest extends MediaWikiIntegrationTestCase {
|
|
|
|
|
|
|
|
public function testGetLoggedInPushId(): void {
|
|
|
|
$user = $this->getTestUser()->getUser();
|
|
|
|
$this->assertGreaterThan( 0, Utils::getPushUserId( $user ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetLoggedOutPushId(): void {
|
|
|
|
$user = $this->getTestUser()->getUser();
|
|
|
|
$user->doLogout();
|
|
|
|
$this->assertSame( 0, Utils::getPushUserId( $user ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|