EDITest\InterpreterTest::testCOARRI PHP Method

testCOARRI() public method

public testCOARRI ( )
    public function testCOARRI()
    {
        $parser = new Parser(__DIR__ . "/../files/D95BCOARRI.edi");
        $mapping = new \EDI\Mapping\MappingProvider('D95B');
        $analyser = new Analyser();
        $segs = $analyser->loadSegmentsXml($mapping->getSegments());
        $svc = $analyser->loadSegmentsXml($mapping->getServiceSegments(3));
        $interpreter = new Interpreter($mapping->getMessage('coarri'), $segs, $svc);
        $interpreter->prepare($parser->get());
        $this->assertJsonStringEqualsJsonFile(__DIR__ . "/../files/D95BCOARRI.json", $interpreter->getJson(), "JSON does not match expected output");
        $this->assertEquals(include __DIR__ . "/../files/messages/coarri.php", $interpreter->getMessages(), "Unable to get the correct message structure array");
        $this->assertCount(5, $interpreter->getMessages());
        $this->assertCount(4, $interpreter->getErrors());
        $this->assertCount(2, $interpreter->getServiceSegments());
        $this->assertEquals([[], [], [], []], $interpreter->getErrors());
    }