annotate vendor/consolidation/output-formatters/tests/testAPIDocs.php @ 9:1fc0ff908d1f

Add another data file
author Chris Cannam
date Mon, 05 Feb 2018 12:34:32 +0000
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2 namespace Consolidation\OutputFormatters;
Chris@0 3
Chris@0 4 use Consolidation\OutputFormatters\Options\FormatterOptions;
Chris@0 5 use Symfony\Component\Console\Input\StringInput;
Chris@0 6 use Symfony\Component\Console\Input\InputOption;
Chris@0 7 use Symfony\Component\Console\Input\InputArgument;
Chris@0 8 use Symfony\Component\Console\Input\InputDefinition;
Chris@0 9
Chris@0 10 class APIDocsTests extends \PHPUnit_Framework_TestCase
Chris@0 11 {
Chris@0 12 function testAPIDocs()
Chris@0 13 {
Chris@0 14 if (getenv('CI')) {
Chris@0 15 $this->markTestIncomplete(
Chris@0 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.'
Chris@0 17 );
Chris@0 18 }
Chris@0 19
Chris@0 20 $testDocs = tempnam(sys_get_temp_dir(), 'TestAPIDocs.md');
Chris@0 21 $currentDocs = getcwd() . '/docs/api.md';
Chris@0 22 passthru("vendor/bin/phpdoc-md generate src > $testDocs");
Chris@0 23
Chris@0 24 $testDocsContent = file_get_contents($testDocs);
Chris@0 25 $currentDocsContent = file_get_contents($currentDocs);
Chris@0 26
Chris@0 27 $testDocsContent = str_replace (array("\r\n", "\r"), "\n", $testDocsContent);
Chris@0 28 $currentDocsContent = str_replace (array("\r\n", "\r"), "\n", $currentDocsContent);
Chris@0 29
Chris@0 30 $this->assertEquals($testDocsContent, $currentDocsContent, "API docuementation out of date. Run 'composer api' to update.");
Chris@0 31 }
Chris@0 32 }