commit | author | age
|
a2a1f8
|
1 |
<?php |
AM |
2 |
|
|
3 |
class Selenium_Mail_Getunread extends Selenium_Test |
|
4 |
{ |
28b1cb
|
5 |
protected $msgcount = 0; |
TB |
6 |
|
|
7 |
protected function setUp() |
|
8 |
{ |
|
9 |
parent::setUp(); |
|
10 |
|
|
11 |
bootstrap::init_imap(); |
|
12 |
bootstrap::purge_mailbox('INBOX'); |
|
13 |
|
|
14 |
// import email messages |
|
15 |
foreach (glob(TESTS_DIR . 'Selenium/data/mail/list_*.eml') as $f) { |
|
16 |
bootstrap::import_message($f, 'INBOX'); |
|
17 |
$this->msgcount++; |
|
18 |
} |
|
19 |
} |
|
20 |
|
a2a1f8
|
21 |
public function testGetunread() |
AM |
22 |
{ |
|
23 |
$this->go('mail'); |
|
24 |
|
|
25 |
$res = $this->ajaxResponse('getunread', "rcmail.http_request('getunread')"); |
|
26 |
$this->assertEquals('getunread', $res['action']); |
28b1cb
|
27 |
|
TB |
28 |
$env = $this->get_env(); |
|
29 |
$this->assertEquals($env['unread_counts']['INBOX'], $this->msgcount); |
|
30 |
|
|
31 |
$li = $this->byCssSelector('.folderlist li.inbox'); |
|
32 |
$this->assertHasClass('unread', $li); |
|
33 |
|
|
34 |
$badge = $this->byCssSelector('.folderlist li.inbox span.unreadcount'); |
9311fe
|
35 |
$this->assertEquals(strval($this->msgcount), $this->getText($badge)); |
a2a1f8
|
36 |
} |
AM |
37 |
} |