|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Tests\Bpost\HttpRequestBuilder; |
|
4
|
|
|
|
|
5
|
|
|
use Bpost\BpostApiClient\Bpost\HttpRequestBuilder\ModifyOrder; |
|
6
|
|
|
use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; |
|
7
|
|
|
use PHPUnit_Framework_TestCase; |
|
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
class ModifyOrderTest extends PHPUnit_Framework_TestCase |
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* @param array $input |
|
13
|
|
|
* @param string $url |
|
14
|
|
|
* @param string $xml |
|
15
|
|
|
* @param array $headers |
|
16
|
|
|
* @param string $method |
|
17
|
|
|
* @param bool $isExpectXml |
|
18
|
|
|
* |
|
19
|
|
|
* @throws BpostInvalidValueException |
|
20
|
|
|
* |
|
21
|
|
|
* @dataProvider dataResults |
|
22
|
|
|
*/ |
|
23
|
|
|
public function testResults(array $input, $url, $xml, $headers, $method, $isExpectXml) |
|
24
|
|
|
{ |
|
25
|
|
|
$builder = new ModifyOrder($input[0], $input[1]); |
|
26
|
|
|
|
|
27
|
|
|
$this->assertSame($url, $builder->getUrl()); |
|
28
|
|
|
$this->assertSame($method, $builder->getMethod()); |
|
29
|
|
|
$this->assertSame($xml, $builder->getXml()); |
|
30
|
|
|
$this->assertSame($isExpectXml, $builder->isExpectXml()); |
|
31
|
|
|
$this->assertSame($headers, $builder->getHeaders()); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function testInvalidValue() |
|
35
|
|
|
{ |
|
36
|
|
|
$this->expectException('Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException'); |
|
37
|
|
|
new ModifyOrder('123', 'maybe'); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public function dataResults() |
|
41
|
|
|
{ |
|
42
|
|
|
return array( |
|
43
|
|
|
array( |
|
44
|
|
|
'input' => array('123', 'pending'), |
|
45
|
|
|
'url' => '/orders/123', |
|
46
|
|
|
'xml' => '<?xml version="1.0" encoding="utf-8"?> |
|
47
|
|
|
<orderUpdate xmlns="http://schema.post.be/shm/deepintegration/v3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
|
48
|
|
|
<status>PENDING</status> |
|
49
|
|
|
</orderUpdate> |
|
50
|
|
|
', |
|
51
|
|
|
'headers' => array('Content-type: application/vnd.bpost.shm-orderUpdate-v3+XML'), |
|
52
|
|
|
'method' => 'POST', |
|
53
|
|
|
'isExpectXml' => false, |
|
54
|
|
|
), |
|
55
|
|
|
); |
|
56
|
|
|
} |
|
57
|
|
|
} |
|
58
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths