Exemplo n.º 1
0
 /**
  * Returns current test section.
  * @param  string
  * @param  string
  * @return mixed
  */
 public static function getSection($file, $section)
 {
     if (!isset(self::$sections[$file])) {
         self::$sections[$file] = TestCase::parseSections($file);
     }
     $lowerSection = strtolower($section);
     if (!isset(self::$sections[$file][$lowerSection])) {
         throw new Exception("Missing section '{$section}' in file '{$file}'.");
     }
     if (in_array($section, array('GET', 'POST', 'SERVER'), TRUE)) {
         return TestCase::parseLines(self::$sections[$file][$lowerSection], '=');
     } else {
         return self::$sections[$file][$lowerSection];
     }
 }