Test Failed
Push — main ( f46f5c...ea931b )
by Bingo
06:50
created

ConstructionSupervisionParseTest::parseModel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Tests\Knd;
4
5
use PHPUnit\Framework\TestCase;
6
use Jabe\Model\Xml\ModelInstanceInterface;
7
use Jabe\Model\Knd\ConstructionSupervision\Impl\RequestParser;
8
9
class ConstructionSupervisionParseTest extends TestCase
10
{
11
    protected $modelParser;
12
13
    protected $modelInstance;
14
15
    /**
16
     * @param string $test
17
     */
18
    protected function parseModel(string $test)
19
    {
20
        $this->modelParser = new RequestParser();
21
        $xml = fopen('tests/Knd/Resources/Examples/' . $test . '.xml', 'r+');
22
        $this->modelInstance = $this->modelParser->parseModelFromStream($xml);
23
    }
24
25
    public function testRequest0(): void
26
    {
27
        $this->parseModel("Request0");
28
        $request = $this->modelInstance->getDocumentElement();
29
        $arr = $request->asArray();
0 ignored issues
show
Bug introduced by
The method asArray() does not exist on Jabe\Model\Xml\Instance\...lementInstanceInterface. It seems like you code against a sub-type of Jabe\Model\Xml\Instance\...lementInstanceInterface such as Jabe\Model\Knd\Construct...nce\Request\ServiceImpl or Jabe\Model\Knd\Construct...st\DocumentPersonalImpl or Jabe\Model\Knd\Construct...\ConstructionPermitImpl or Jabe\Model\Knd\Construct...ethodGettingResultsImpl or Jabe\Model\Knd\Construct...mpetentOrganizationImpl or Jabe\Model\Knd\Construct...stance\Request\DataImpl or Jabe\Model\Knd\Construct...cipientPersonalDataImpl or Jabe\Model\Knd\Construct...adastralNumberBlockImpl or Jabe\Model\Knd\Construct...nce\Request\ServiceImpl or Jabe\Model\Knd\Construct...adastralNumberBlockImpl or Jabe\Model\Knd\Construct...st\DocumentPersonalImpl or Jabe\Model\Knd\Construct...nce\Request\RequestImpl or Jabe\Model\Knd\Construct...mpetentOrganizationImpl or Jabe\Model\Knd\Construct...stance\Request\DataImpl or Jabe\Model\Knd\Construct...ethodGettingResultsImpl or Jabe\Model\Knd\Construct...\ConstructionPermitImpl or Jabe\Model\Knd\Construct...cipientPersonalDataImpl or Jabe\Model\Knd\Construct...nce\Request\RequestImpl. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        /** @scrutinizer ignore-call */ 
30
        $arr = $request->asArray();
Loading history...
30
        $this->assertCount(7, $arr);
31
        $this->assertEquals("01.01.2021", $arr['Service']['currentDate']);
32
    }
33
}
34