CloverTest.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  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\Clover
  14. */
  15. class CloverTest extends TestCase
  16. {
  17. public function testCloverForBankAccountTest()
  18. {
  19. $clover = new Clover;
  20. $this->assertStringMatchesFormatFile(
  21. TEST_FILES_PATH . 'BankAccount-clover.xml',
  22. $clover->process($this->getCoverageForBankAccount(), null, 'BankAccount')
  23. );
  24. }
  25. public function testCloverForFileWithIgnoredLines()
  26. {
  27. $clover = new Clover;
  28. $this->assertStringMatchesFormatFile(
  29. TEST_FILES_PATH . 'ignored-lines-clover.xml',
  30. $clover->process($this->getCoverageForFileWithIgnoredLines())
  31. );
  32. }
  33. public function testCloverForClassWithAnonymousFunction()
  34. {
  35. $clover = new Clover;
  36. $this->assertStringMatchesFormatFile(
  37. TEST_FILES_PATH . 'class-with-anonymous-function-clover.xml',
  38. $clover->process($this->getCoverageForClassWithAnonymousFunction())
  39. );
  40. }
  41. }