2 namespace Consolidation\OutputFormatters;
4 use Consolidation\OutputFormatters\Options\FormatterOptions;
5 use Symfony\Component\Console\Input\StringInput;
6 use Symfony\Component\Console\Input\InputOption;
7 use Symfony\Component\Console\Input\InputArgument;
8 use Symfony\Component\Console\Input\InputDefinition;
10 class APIDocsTests extends \PHPUnit_Framework_TestCase
12 function testAPIDocs()
15 $this->markTestIncomplete(
16 'API generation has slight variations when run on CI server. This test is therefore skipped on CI until we can make the test results consistent.'
20 $testDocs = tempnam(sys_get_temp_dir(), 'TestAPIDocs.md');
21 $currentDocs = getcwd() . '/docs/api.md';
22 passthru("vendor/bin/phpdoc-md generate src > $testDocs");
24 $testDocsContent = file_get_contents($testDocs);
25 $currentDocsContent = file_get_contents($currentDocs);
27 $testDocsContent = str_replace (array("\r\n", "\r"), "\n", $testDocsContent);
28 $currentDocsContent = str_replace (array("\r\n", "\r"), "\n", $currentDocsContent);
30 $this->assertEquals($testDocsContent, $currentDocsContent, "API docuementation out of date. Run 'composer api' to update.");