for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace exussum12\CoverageChecker\tests;
use Exception;
use PHPUnit\Framework\TestCase;
/**
* Ignored due to acceptance test needing to write values
* @SuppressWarnings(PHPMD.Superglobals)
*/
class PhpCsReflectionTest extends TestCase
{
public function testRelatedMethods()
$GLOBALS['argv'] = [
'diffFilter',
'--phpcs',
'--report=json',
__DIR__ . '/fixtures/DocBlocks.txt',
__DIR__ . '/fixtures/DocBlocks.json'
];
try {
ob_start();
require(__DIR__ . "/../src/Runners/generic.php");
} catch (Exception $exception) {
$output = json_decode(ob_get_clean());
$file = $output->violations->{'DocBlocks.php'};
$this->assertEquals(
14,
count($file)
);
5,
count($file[12]->message)
return true;
}
$this->fail('Exception not thrown when Expected');
public function testRelatedMethodsFileNotFound()
__DIR__ . '/fixtures/DocBlocksNotFound.json'
$output = ob_get_clean();
$this->assertContains("Can't find file", $output);