Yaffs site version 1.1
[yaffs-website] / vendor / consolidation / output-formatters / tests / testAPIDocs.php
1 <?php
2 namespace Consolidation\OutputFormatters;
3
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;
9
10 class APIDocsTests extends \PHPUnit_Framework_TestCase
11 {
12     function testAPIDocs()
13     {
14         if (getenv('CI')) {
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.'
17             );
18         }
19
20         $testDocs = tempnam(sys_get_temp_dir(), 'TestAPIDocs.md');
21         $currentDocs = getcwd() . '/docs/api.md';
22         passthru("vendor/bin/phpdoc-md generate src > $testDocs");
23
24         $testDocsContent = file_get_contents($testDocs);
25         $currentDocsContent = file_get_contents($currentDocs);
26
27         $testDocsContent = str_replace (array("\r\n", "\r"), "\n", $testDocsContent);
28         $currentDocsContent = str_replace (array("\r\n", "\r"), "\n", $currentDocsContent);
29
30         $this->assertEquals($testDocsContent, $currentDocsContent, "API docuementation out of date. Run 'composer api' to update.");
31     }
32 }