Test Setup Failed
Push — master ( 2047f0...e15812 )
by Gennady
03:31
created

MessageTest::testSetPriority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Apns;
4
5
class MessageTest extends \PHPUnit_Framework_TestCase
6
{
7
    public function testCreation()
8
    {
9
        $msg = new Message();
10
        $this->assertEquals(['aps' => []], $msg->getMessageBody());
11
        $this->assertNull($msg->getDeviceIdentifier());
12
    }
13
14
    public function testCreationWithDeviceIdentifier()
15
    {
16
        $msg = new Message('foo');
17
        $this->assertSame('foo', $msg->getDeviceIdentifier());
18
    }
19
20
    public function testSetTopic()
21
    {
22
        $msg = new Message();
23
        $msg->setTopic('foo');
24
        $this->assertEquals('foo', $msg->getTopic());
25
        $this->assertEquals(['apns-topic' => 'foo'], $msg->getMessageHeaders());
26
    }
27
28
    public function testSetPriority()
29
    {
30
        $msg = new Message();
31
        $msg->setPriority(10);
32
        $this->assertEquals(10, $msg->getPriority());
33
        $this->assertEquals(['apns-priority' => 10], $msg->getMessageHeaders());
34
    }
35
36
}