Skip to content

Parse returns a file path #1

@phpengine

Description

@phpengine

Hi there, I think my issue may be that I do not know Twig well. When I run the parse method I get a string back of a file path, where I was expecting html. I'm writing a small script to read junit xml and output html using the library.

``use Naroga\JUnitParser\Parser;

$all_files = scandir($source) ;
foreach ($all_files as $one_file) {
if (!in_array($one_file, array('.', '..'))) {
$file_content = file_get_contents($source.$one_file) ;
if (!isset($parser)) {
$twig = new \Twig_Environment(new \Twig_Loader_String());
$parser = new Parser($twig, $file_content);
} else {
$parser->addXmlContent($file_content);
}
}
}

$html = $parser->parse('html'); //Returns HTML result.
var_dump($html);
file_put_contents($target, $html) ;
``

At the point of the var dump, I get /path/to/project/vendor/naroga/php-junit-parser/Resources/view/report.html.twig . Could you please tell me what I've done wrong? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions