Example #1
0
 /**
  * Parses the given source file or directory with the default tokenizer
  * and node builder implementations.
  *
  * @param string  $testCase          Qualified test case name.
  * @param boolean $ignoreAnnotations The parser should ignore annotations.
  *
  * @return PHP_Depend_Code_NodeIterator
  */
 public static function parseTestCaseSource($testCase, $ignoreAnnotations = false)
 {
     list($class, $method) = explode('::', $testCase);
     $parts = explode('_', $class);
     try {
         return parent::parseSource(sprintf('Metrics/%s/%s.php', $parts[count($parts) - 2], $method), $ignoreAnnotations);
     } catch (Exception $e) {
     }
     return parent::parseSource(sprintf('Metrics/%s/%s', $parts[count($parts) - 2], $method), $ignoreAnnotations);
 }
Example #2
0
 /**
  * Parses the given source file or directory with the default tokenizer
  * and node builder implementations.
  *
  * @param string  $testCase          Qualified test case name.
  * @param boolean $ignoreAnnotations The parser should ignore annotations.
  *
  * @return PHP_Depend_Code_NodeIterator
  */
 public static function parseTestCaseSource($testCase, $ignoreAnnotations = false)
 {
     list($class, $method) = explode('::', $testCase);
     return parent::parseSource(sprintf('code/%s/%s.php', substr($class, strrpos($class, '_') + 1, -4), $method), $ignoreAnnotations);
 }
Example #3
0
 /**
  * Parses test code for the calling test case.
  *
  * @param string  $testCase          Name of the calling test case.
  * @param boolean $ignoreAnnotations Should the parser ignore annotations?
  *
  * @return PHP_Depend_Code_NodeIterator
  */
 public static function parseTestCaseSource($testCase, $ignoreAnnotations = false)
 {
     list($className, $methodName) = explode('::', $testCase);
     $directory = substr($className, 18, -4);
     return parent::parseSource("parser/{$directory}/{$methodName}.php", $ignoreAnnotations);
 }