-
Notifications
You must be signed in to change notification settings - Fork 1
/
FlagActionTest.php
37 lines (32 loc) · 1.04 KB
/
FlagActionTest.php
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
<?php
namespace Zimbra\Mail\Tests\Struct;
use Zimbra\Mail\Tests\ZimbraMailTestCase;
use Zimbra\Mail\Struct\FlagAction;
/**
* Testcase class for FlagAction.
*/
class FlagActionTest extends ZimbraMailTestCase
{
public function testFlagAction()
{
$index = mt_rand(1, 10);
$flag = $this->faker->word;
$actionFlag = new FlagAction(
$index, $flag
);
$this->assertInstanceOf('\Zimbra\Mail\Struct\FilterAction', $actionFlag);
$this->assertSame($flag, $actionFlag->getFlag());
$actionFlag->setFlag($flag);
$this->assertSame($flag, $actionFlag->getFlag());
$xml = '<?xml version="1.0"?>' . "\n"
.'<actionFlag index="' . $index . '" flagName="' . $flag . '" />';
$this->assertXmlStringEqualsXmlString($xml, (string) $actionFlag);
$array = array(
'actionFlag' => array(
'index' => $index,
'flagName' => $flag,
),
);
$this->assertEquals($array, $actionFlag->toArray());
}
}