public function testClassKnowsIfALineHasCoverage()
 {
     $line0 = new CoveredLine("line0");
     $line1 = new CoveredLine("line1");
     $class = new CoveredClass();
     $class->addLine(0, $line0);
     $class->addLine(1, $line1);
     $this->assertFalse($class->isCovered());
     $line0->addCoverage("");
     $this->assertTrue($class->isCovered());
 }
 public function testSupportsClassKnowsWhichClassesAreSupported()
 {
     // arrange
     $class = new CoveredClass();
     $class->setNamespace("ImagineryNamespace");
     $class->setName("SupportedClass");
     // act
     $factory = new ProxyFactory(array($class));
     // assert
     $this->assertTrue($factory->supports('\\ImagineryNamespace\\SupportedClass'));
     $this->assertFalse($factory->supports('\\ImagineryNamespace\\UnsupportedClass'));
 }
 /**
  * @param integer $lineNumber
  */
 public function addLine($lineNumber, Line $line)
 {
     if ($line->isClass()) {
         $line = new DynamicClassnameCoveredLine($line);
         $this->classLine = $line;
     }
     parent::addLine($lineNumber, $line);
 }
 /**
  * @dataProvider canonicalClassnameDataProvider
  * @param $namespace
  * @param $name
  * @param $expected
  */
 public function testGetCanonicalClassname($namespace, $name, $expected)
 {
     $input = new CoveredClass();
     $input->setNamespace($namespace);
     $input->setName($name);
     $proxy = new ProxyAccessor($input);
     $this->assertEquals($expected, $proxy->getCanonicalClassName($input));
 }