Bpack247Test::testGetUserAgent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Bpost\BpostApiClient\Bpack247\test;
4
5
use Bpost\BpostApiClient\Bpack247;
6
use PHPUnit_Framework_TestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit_Framework_TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class Bpack247Test extends PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @var Bpack247
12
     */
13
    private $bpack247;
14
15
    /**
16
     * Prepares the environment before running a test.
17
     */
18
    protected function setUp()
19
    {
20
        parent::setUp();
21
        $this->bpack247 = new Bpack247(BPACK_EMAIL, BPACK_PASSPHRASE);
22
    }
23
24
    /**
25
     * Cleans up the environment after running a test.
26
     */
27
    protected function tearDown()
28
    {
29
        $this->bpack247 = null;
30
        parent::tearDown();
31
    }
32
33
    /**
34
     * Tests Bpack247->getTimeOut()
35
     */
36
    public function testGetTimeOut()
37
    {
38
        $this->bpack247->setTimeOut(5);
39
        $this->assertSame(5, $this->bpack247->getTimeOut());
40
    }
41
42
    /**
43
     * Tests Bpack247->getUserAgent()
44
     */
45
    public function testGetUserAgent()
46
    {
47
        $this->bpack247->setUserAgent('testing/1.0.0');
48
        $this->assertSame(
49
            'PHP Bpost Bpack247/' . Bpack247::VERSION . ' testing/1.0.0',
50
            $this->bpack247->getUserAgent()
51
        );
52
    }
53
54
    /**
55
     * Tests Bpack247->getMember()
56
     */
57
    public function testGetMember()
58
    {
59
        $this->markTestSkipped('Need to create a member before the test');
60
61
        $data = array(
62
            'id' => '344337728',
63
            'UserId' => '5f1f1b07-a8c4-4d4c-bd5b-cdace6cb7c84',
64
        );
65
66
        // @todo    create a member
67
        $response = $this->bpack247->getMember($data['id']);
68
        $this->assertSame($data['UserId'], $response->getUserID());
69
    }
70
}
71