Phan\Tests\Output\Printer\CSVPrinterTest::testHeaderCorrespondsToData PHP Method

testHeaderCorrespondsToData() public method

    public function testHeaderCorrespondsToData()
    {
        $output = new BufferedOutput();
        $printer = new CSVPrinter();
        $printer->configureOutput($output);
        $printer->print(new IssueInstance(Issue::fromType(Issue::SyntaxError), 'test.php', 0, ["foo"]));
        $printer->flush();
        $lines = array_map("str_getcsv", explode("\n", $output->fetch()));
        $fields = array_combine($lines[0], $lines[1]);
        $this->assertEquals("test.php", $fields["filename"]);
        $this->assertEquals(0, $fields["line"]);
        $this->assertEquals(10, $fields["severity_ord"]);
        $this->assertEquals("critical", $fields["severity_name"]);
        $this->assertEquals("UndefError", $fields["category"]);
        $this->assertEquals("PhanSyntaxError", $fields["check_name"]);
        $this->assertEquals("foo", $fields["message"]);
    }