Crap4jTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php declare(strict_types=1);
  2. /*
  3. * This file is part of the php-code-coverage package.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace SebastianBergmann\CodeCoverage\Report;
  11. use SebastianBergmann\CodeCoverage\TestCase;
  12. /**
  13. * @covers SebastianBergmann\CodeCoverage\Report\Crap4j
  14. */
  15. class Crap4jTest extends TestCase
  16. {
  17. public function testForBankAccountTest(): void
  18. {
  19. $crap4j = new Crap4j;
  20. $this->assertStringMatchesFormatFile(
  21. TEST_FILES_PATH . 'BankAccount-crap4j.xml',
  22. $crap4j->process($this->getCoverageForBankAccount(), null, 'BankAccount')
  23. );
  24. }
  25. public function testForFileWithIgnoredLines(): void
  26. {
  27. $crap4j = new Crap4j;
  28. $this->assertStringMatchesFormatFile(
  29. TEST_FILES_PATH . 'ignored-lines-crap4j.xml',
  30. $crap4j->process($this->getCoverageForFileWithIgnoredLines(), null, 'CoverageForFileWithIgnoredLines')
  31. );
  32. }
  33. public function testForClassWithAnonymousFunction(): void
  34. {
  35. $crap4j = new Crap4j;
  36. $this->assertStringMatchesFormatFile(
  37. TEST_FILES_PATH . 'class-with-anonymous-function-crap4j.xml',
  38. $crap4j->process($this->getCoverageForClassWithAnonymousFunction(), null, 'CoverageForClassWithAnonymousFunction')
  39. );
  40. }
  41. }