Completed
Push — master ( 04f203...b3922d )
by Gennady
02:26
created

ClientTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateSandbox() 0 5 1
A testCreateProd() 0 5 1
A testCreatePushURI() 0 8 1
1
<?php
2
3
namespace Apns;
4
5
class ClientTest extends \PHPUnit_Framework_TestCase
6
{
7
    public function testCreateSandbox()
8
    {
9
        $client = new Client('', true);
10
        $this->assertContains('development', $client->getServer());
11
    }
12
13
    public function testCreateProd()
14
    {
15
        $client = new Client('', false);
16
        $this->assertNotContains('development', $client->getServer());
17
    }
18
19
    public function testCreatePushURI()
20
    {
21
        $client = new Client('', true);
22
        $pushUri = $client->getPushURI((new Message())->setDeviceIdentifier('foobar'));
23
24
        $this->assertContains('development', $pushUri);
25
        $this->assertContains('foobar', $pushUri);
26
    }
27
}