You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
roundcubemail/tests/Selenium/Mail/Getunread.php

38 lines
1.0 KiB
PHTML

<?php
class Selenium_Mail_Getunread extends Selenium_Test
{
protected $msgcount = 0;
protected function setUp()
{
parent::setUp();
bootstrap::init_imap();
bootstrap::purge_mailbox('INBOX');
// import email messages
foreach (glob(TESTS_DIR . 'Selenium/data/mail/list_*.eml') as $f) {
bootstrap::import_message($f, 'INBOX');
$this->msgcount++;
}
}
public function testGetunread()
{
$this->go('mail');
$res = $this->ajaxResponse('getunread', "rcmail.http_request('getunread')");
$this->assertEquals('getunread', $res['action']);
$env = $this->get_env();
$this->assertEquals($env['unread_counts']['INBOX'], $this->msgcount);
$li = $this->byCssSelector('.folderlist li.inbox');
$this->assertHasClass('unread', $li);
$badge = $this->byCssSelector('.folderlist li.inbox span.unreadcount');
$this->assertEquals(strval($this->msgcount), $badge->text());
}
}