/**
  * @param string $content
  * @return DynamicClassnameCoveredClass
  */
 public function parseString($content)
 {
     $class = new DynamicClassnameCoveredClass();
     $class->setName($this->parseName($content));
     $class->setNamespace($this->parseNamespace($content));
     $lines = explode("\n", $content);
     $lineNumber = 1;
     foreach ($lines as $lineAsString) {
         $line = $this->parseLine($lineAsString);
         $class->addLine($lineNumber++, $line);
     }
     return $class;
 }
 /**
  * @param $namespace
  * @param $classname
  * @return CoveredClass
  */
 private function createFakeClass($namespace, $classname)
 {
     $line0 = new CoveredLine("namespace " . $namespace . ";");
     $line1 = new CoveredLine("class " . $classname . "{");
     $line1->setClassName($classname);
     $line1->setClass(true);
     $line2 = new CoveredLine("}");
     $class = new DynamicClassnameCoveredClass();
     $class->setName($classname);
     $class->addLine(0, $line0);
     $class->addLine(1, $line1);
     $class->addLine(2, $line2);
     $class->setNamespace($namespace);
     return $class;
 }
 public function testLoadClassReturnsTrueOnParsingSuccess()
 {
     $class = new DynamicClassnameCoveredClass();
     $class->setName("MyOtherName");
     $class->setNamespace("MyNamespace");
     $class->addLine(0, new CoveredLine("namespace MyNamespace;"));
     $line1 = new CoveredLine("class MyOtherName{");
     $line1->setClass(true);
     $line1->setClassName("MyOtherName");
     $class->addLine(1, $line1);
     $class->addLine(2, new CoveredLine("}"));
     $proxy = new ProxyAccessor($class);
     $proxy->load();
     $this->assertTrue($proxy->loadClass($class));
 }