Changeset View
Changeset View
Standalone View
Standalone View
src/unit/engine/phutil/PhutilTestCase.php
Context not available. | |||||
$output .= "\n"; | $output .= "\n"; | ||||
if (strpos($expect, "\n") === false && strpos($result, "\n") === false) { | if (@strpos($expect, "\n") === false && @strpos($result, "\n") === false) { | ||||
$output .= pht("Expected: %s\n Actual: %s", $expect, $result); | $output .= pht("Expected: %s\n Actual: %s", $expect, $result); | ||||
} else { | } else { | ||||
$output .= pht( | $output .= pht( | ||||
Context not available. | |||||
$this->willRunTests(); | $this->willRunTests(); | ||||
foreach ($methods as $method) { | foreach ($methods as $method) { | ||||
$name = $method->getName(); | $name = $method->getName(); | ||||
if (preg_match('/^test/', $name)) { | if (@preg_match('/^test/', $name)) { | ||||
$this->runningTest = $name; | $this->runningTest = $name; | ||||
$this->assertions = 0; | $this->assertions = 0; | ||||
$this->testStartTime = microtime(true); | $this->testStartTime = microtime(true); | ||||
Context not available. | |||||
foreach ($result as $file => $report) { | foreach ($result as $file => $report) { | ||||
$project_root = $this->getProjectRoot(); | $project_root = $this->getProjectRoot(); | ||||
if (strncmp($file, $project_root, strlen($project_root))) { | if (strncmp($file, $project_root, @strlen($project_root))) { | ||||
continue; | continue; | ||||
} | } | ||||
Context not available. | |||||
$str .= 'N'; // Not executable. | $str .= 'N'; // Not executable. | ||||
} | } | ||||
} | } | ||||
$coverage[substr($file, strlen($project_root) + 1)] = $str; | $coverage[@substr($file, @strlen($project_root) + 1)] = $str; | ||||
} | } | ||||
// Only keep coverage information for files modified by the change. In | // Only keep coverage information for files modified by the change. In | ||||
Context not available. | |||||
foreach (array_slice(debug_backtrace(), 1) as $location) { | foreach (array_slice(debug_backtrace(), 1) as $location) { | ||||
$function = idx($location, 'function'); | $function = idx($location, 'function'); | ||||
if (!$seen && preg_match('/^assert[A-Z]/', $function)) { | if (!$seen && @preg_match('/^assert[A-Z]/', $function)) { | ||||
$seen = true; | $seen = true; | ||||
$caller = $location; | $caller = $location; | ||||
} else if ($seen && !preg_match('/^assert[A-Z]/', $function)) { | } else if ($seen && !@preg_match('/^assert[A-Z]/', $function)) { | ||||
$callee = $location; | $callee = $location; | ||||
break; | break; | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0