zangra-dev /
bpost-api-library
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Tests\Bpost\Order; |
||
| 4 | |||
| 5 | use Bpost\BpostApiClient\Bpost\Order\Line; |
||
| 6 | use DOMDocument; |
||
| 7 | use PHPUnit_Framework_TestCase; |
||
|
0 ignored issues
–
show
|
|||
| 8 | |||
| 9 | class LineTest extends PHPUnit_Framework_TestCase |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Create a generic DOM Document |
||
| 13 | * |
||
| 14 | * @return DOMDocument |
||
| 15 | */ |
||
| 16 | private static function createDomDocument() |
||
| 17 | { |
||
| 18 | $document = new DOMDocument('1.0', 'utf-8'); |
||
| 19 | $document->preserveWhiteSpace = false; |
||
| 20 | $document->formatOutput = true; |
||
| 21 | |||
| 22 | return $document; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Tests Line->toXML |
||
| 27 | */ |
||
| 28 | public function testToXML() |
||
| 29 | { |
||
| 30 | $data = array( |
||
| 31 | 'text' => 'just a random text', |
||
| 32 | 'nbOfItems' => time(), |
||
| 33 | ); |
||
| 34 | |||
| 35 | $expectedDocument = self::createDomDocument(); |
||
| 36 | $line = $expectedDocument->createElement('orderLine'); |
||
| 37 | foreach ($data as $key => $value) { |
||
| 38 | $line->appendChild( |
||
| 39 | $expectedDocument->createElement($key, $value) |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | $expectedDocument->appendChild($line); |
||
| 43 | |||
| 44 | $actualDocument = self::createDomDocument(); |
||
| 45 | $line = new Line( |
||
| 46 | $data['text'], |
||
| 47 | $data['nbOfItems'] |
||
| 48 | ); |
||
| 49 | $actualDocument->appendChild( |
||
| 50 | $line->toXML($actualDocument, null) |
||
| 51 | ); |
||
| 52 | |||
| 53 | $this->assertEquals($expectedDocument, $actualDocument); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
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