ServiceTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 16
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateFromXml() 0 22 1
1
<?php
2
3
namespace Tests\Geo6;
4
5
use Bpost\BpostApiClient\Geo6\Service;
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 ServiceTest extends PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * Tests Service::createFromXml()
12
     */
13
    public function testCreateFromXml()
14
    {
15
        $data = array(
16
            'category' => '2',
17
            'flag' => '10',
18
            'Name' => 'Loket met Bancontact/Mistercash',
19
        );
20
21
        // build xml
22
        $xmlString = '<Service';
23
        $xmlString .= ' category="' . $data['category'] . '"';
24
        $xmlString .= ' flag="' . $data['flag'] . '"';
25
        $xmlString .= '>';
26
        $xmlString .= $data['Name'];
27
        $xmlString .= '</Service>';
28
        $xml = simplexml_load_string($xmlString);
29
30
        $service = Service::createFromXML($xml);
31
32
        $this->assertSame($data['category'], $service->getCategory());
33
        $this->assertSame($data['flag'], $service->getFlag());
34
        $this->assertSame($data['Name'], $service->getName());
35
    }
36
}
37