Completed
Push — master ( 58620c...f23d9f )
by Vitaliy
02:20
created

MessageTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A shouldThrowExceptionIfTrySetInvalidCustomData() 0 5 1
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\ApsData;
15
use Apple\ApnPush\Model\Message;
16
use PHPUnit\Framework\TestCase;
17
18
class MessageTest extends TestCase
19
{
20
    /**
21
     * @test
22
     *
23
     * @expectedException \InvalidArgumentException
24
     * @expectedExceptionMessage The custom data value should be a scalar or \JsonSerializable instance, but "stdClass" given.
25
     */
26
    public function shouldThrowExceptionIfTrySetInvalidCustomData()
27
    {
28
        $message = new Message(new ApsData());
29
        $message->withCustomData('some', new \stdClass());
30
    }
31
}
32