/** * @param \CliTester $I * @param \Codeception\Scenario $scenario */ public function testDocumentValidHtml(\CliTester $I, \Codeception\Scenario $scenario) { $I->wantTo('verify that the default template produces valid HTML'); if (!class_exists('Tidy')) { $scenario->skip('Tidy is not available. See http://php.net/manual/en/tidy.installation.php'); } $template = dirname(dirname(__DIR__)) . '/src/Task/CodeSniffer/codestyle.html'; $outfile = dirname(__DIR__) . '/_output/codestyle.html'; if (file_exists($outfile)) { unlink($outfile); } $I->dontSeeFileFound($outfile); $I->runShellCommand('vendor/bin/robo document:codestyle --outfile ' . $outfile . ' --template ' . $template); $I->seeFileFound($outfile); $tidy = new \Tidy(); $tidy->parseFile($outfile); $I->assertEquals(0, $tidy->getStatus()); unlink($outfile); }