-
Notifications
You must be signed in to change notification settings - Fork 316
Expand file tree
/
Copy pathMessageFlaggedEventTest.php
More file actions
45 lines (35 loc) · 1.18 KB
/
MessageFlaggedEventTest.php
File metadata and controls
45 lines (35 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Mail\Tests\Unit\Events;
use ChristophWurst\Nextcloud\Testing\TestCase;
use OCA\Mail\Account;
use OCA\Mail\Db\Mailbox;
use OCA\Mail\Events\MessageFlaggedEvent;
class MessageFlaggedEventTest extends TestCase {
public function testConstructorAndGetters(): void {
$account = $this->createStub(Account::class);
$mailbox = $this->createStub(Mailbox::class);
$uid = 12345;
$flag = 'Seen';
$set = true;
$event = new MessageFlaggedEvent($account, $mailbox, $uid, $flag, $set);
$this->assertSame($account, $event->getAccount());
$this->assertSame($mailbox, $event->getMailbox());
$this->assertSame($uid, $event->getUid());
$this->assertSame($flag, $event->getFlag());
$this->assertTrue($event->isSet());
}
public function testFlagUnset(): void {
$account = $this->createStub(Account::class);
$mailbox = $this->createStub(Mailbox::class);
$uid = 99999;
$flag = 'Flagged';
$set = false;
$event = new MessageFlaggedEvent($account, $mailbox, $uid, $flag, $set);
$this->assertFalse($event->isSet());
}
}