N98\Magento\Command\System\Setup\CompareVersionsCommand::logJUnit PHP Method

logJUnit() protected method

protected logJUnit ( array $data, string $filename, float $duration )
$data array
$filename string
$duration float
    protected function logJUnit(array $data, $filename, $duration)
    {
        $document = new JUnitXmlDocument();
        $suite = $document->addTestSuite();
        $suite->setName('n98-magerun: ' . $this->getName());
        $suite->setTimestamp(new \DateTime());
        $suite->setTime($duration);
        $testCase = $suite->addTestCase();
        $testCase->setName('Magento Setup Version Test');
        $testCase->setClassname('CompareVersionsCommand');
        if (count($data) > 0) {
            foreach ($data as $moduleSetup) {
                if (stristr($moduleSetup['Status'], 'error')) {
                    $testCase->addFailure(sprintf('Setup Script Error: [Setup %s]', $moduleSetup['Setup']), 'MagentoSetupScriptVersionException');
                }
            }
        }
        $document->save($filename);
    }
CompareVersionsCommand