2018-01-02 02:58:08 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @group API
|
|
|
|
|
* @group medium
|
|
|
|
|
* @covers ApiClearHasMsg
|
|
|
|
|
*/
|
|
|
|
|
class ApiClearHasMsgTest extends ApiTestCase {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Test clearing hasmsg flag for current user
|
|
|
|
|
*/
|
|
|
|
|
public function testClearFlag() {
|
|
|
|
|
$user = self::$users['sysop']->getUser();
|
|
|
|
|
$user->setNewtalk( true );
|
2018-01-03 02:26:48 +00:00
|
|
|
$this->assertTrue( $user->getNewtalk(), 'sanity check' );
|
2018-01-02 02:58:08 +00:00
|
|
|
|
|
|
|
|
$data = $this->doApiRequest( [ 'action' => 'clearhasmsg' ], [] );
|
|
|
|
|
|
|
|
|
|
$this->assertEquals( 'success', $data[0]['clearhasmsg'] );
|
|
|
|
|
$this->assertFalse( $user->getNewtalk() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|