| Total Complexity | 4 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class PhpunitFilterTest extends TestCase |
||
| 14 | { |
||
| 15 | protected $coverage; |
||
| 16 | protected $diff; |
||
| 17 | protected $matcher; |
||
| 18 | |||
| 19 | public function setUp() |
||
| 20 | { |
||
| 21 | $this->coverage = __DIR__ . '/fixtures/php-coverage.php'; |
||
| 22 | $this->diff = new DiffFileLoader(__DIR__ . '/fixtures/change.txt'); |
||
| 23 | $this->matcher = new FileMatchers\EndsWith(); |
||
| 24 | } |
||
| 25 | public function testBadFilesPassedIn() |
||
| 26 | { |
||
| 27 | $this->expectException(Exception::class); |
||
| 28 | $badFile = 'doesNotExist.blah'; |
||
| 29 | new PhpunitFilter( |
||
| 30 | $this->diff, |
||
| 31 | $this->matcher, |
||
| 32 | $badFile |
||
| 33 | ); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function testOutputOfGetTests() |
||
| 37 | { |
||
| 38 | $this->diff = new DiffFileLoader(__DIR__ . '/fixtures/coverageMatchFiles.txt'); |
||
| 39 | $coverage = new PhpunitFilter( |
||
| 40 | $this->diff, |
||
| 41 | $this->matcher, |
||
| 42 | $this->coverage |
||
| 43 | ); |
||
| 44 | |||
| 45 | $expected = [ |
||
| 46 | 'exussum12\CoverageChecker\tests\ArgParserTest' => [ |
||
| 47 | 'testNumericArgs', |
||
| 48 | ], |
||
| 49 | 'exussum12\CoverageChecker\tests\GenericDiffFilterTest' => [ |
||
| 50 | 'testValid', |
||
| 51 | 'testMissingHandler', |
||
| 52 | ], |
||
| 53 | 'exussum12\CoverageChecker\tests\PhpcsDiffFilterTest' => [ |
||
| 54 | 'testValid', |
||
| 55 | ], |
||
| 56 | ]; |
||
| 57 | $this->assertEquals($expected, $coverage->getTestsForRunning()); |
||
| 58 | } |
||
| 59 | |||
| 60 | public function testUnknownDiffFiles() |
||
| 72 | } |
||
| 73 | } |
||
| 74 |