Completed
Push — master ( b2c31d...142309 )
by Vitaliy
01:49
created

DeviceTokenTest::shouldSuccessCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the AppleApnPush package
5
 *
6
 * (c) Vitaliy Zhuk <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code
10
 */
11
12
namespace Tests\Apple\ApnPush\Model;
13
14
use Apple\ApnPush\Model\DeviceToken;
15
use PHPUnit\Framework\TestCase;
16
17
class DeviceTokenTest extends TestCase
18
{
19
    /**
20
     * @test
21
     *
22
     * @expectedException \InvalidArgumentException
23
     * @expectedExceptionMessage Invalid device token "some".
24
     */
25
    public function shouldThrowsExceptionIfTokenIsInvalid()
26
    {
27
        new DeviceToken('some');
28
    }
29
30
    /**
31
     * @test
32
     */
33
    public function shouldSuccessCreate()
34
    {
35
        $token = new DeviceToken('4e064d251c73cca4096b82b3fbe9abd05d239f96b91a09edb61c92322bf959ca');
36
37
        self::assertEquals('4e064d251c73cca4096b82b3fbe9abd05d239f96b91a09edb61c92322bf959ca', $token->getValue());
38
    }
39
}
40