You are here

public function Util_TestTest::testGetLinesToBeCovered in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/phpunit/tests/Util/TestTest.php \Util_TestTest::testGetLinesToBeCovered()

@covers PHPUnit_Util_Test::getLinesToBeCovered @covers PHPUnit_Util_Test::getLinesToBeCoveredOrUsed @covers PHPUnit_Util_Test::resolveElementToReflectionObjects @dataProvider getLinesToBeCoveredProvider

File

vendor/phpunit/phpunit/tests/Util/TestTest.php, line 398

Class

Util_TestTest
@since Class available since Release 3.3.6

Code

public function testGetLinesToBeCovered($test, $lines) {
  if (strpos($test, 'Namespace') === 0) {
    $expected = array(
      TEST_FILES_PATH . 'NamespaceCoveredClass.php' => $lines,
    );
  }
  elseif ($test === 'CoverageNoneTest') {
    $expected = array();
  }
  elseif ($test === 'CoverageNothingTest') {
    $expected = false;
  }
  elseif ($test === 'CoverageFunctionTest') {
    $expected = array(
      TEST_FILES_PATH . 'CoveredFunction.php' => $lines,
    );
  }
  else {
    $expected = array(
      TEST_FILES_PATH . 'CoveredClass.php' => $lines,
    );
  }
  $this
    ->assertEquals($expected, PHPUnit_Util_Test::getLinesToBeCovered($test, 'testSomething'));
}