mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Docs for find_tested.php
Initial Pass, also fixing the extra space before the extract_tests function name to keep with standards.
This commit is contained in:
parent
668ecaa606
commit
1e4742d5cd
1 changed files with 9 additions and 3 deletions
|
@ -68,7 +68,10 @@ get_phpt_files($extension_test_path, $count, $phpt_files);
|
||||||
|
|
||||||
$extension_method_info = mark_methods_as_tested($extension_method_info, $phpt_files);
|
$extension_method_info = mark_methods_as_tested($extension_method_info, $phpt_files);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The loop to ouput the test coverage info
|
||||||
|
* Should output: Extension, Class Name, Method/Function Name, Test Status, Test Files
|
||||||
|
*/
|
||||||
foreach($extension_method_info as $record) {
|
foreach($extension_method_info as $record) {
|
||||||
echo $record[EXTENSION_NAME] . ",";
|
echo $record[EXTENSION_NAME] . ",";
|
||||||
echo $record[CLASS_NAME] . ",";
|
echo $record[CLASS_NAME] . ",";
|
||||||
|
@ -193,11 +196,14 @@ function get_phpt_files($dir, &$phpt_file_count, &$all_phpt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function extract_tests($file) {
|
/**
|
||||||
|
* Extract tests from a specified file, returns an array of tested function tokens
|
||||||
|
*/
|
||||||
|
function extract_tests($file) {
|
||||||
$code = file_get_contents($file);
|
$code = file_get_contents($file);
|
||||||
|
|
||||||
if (!preg_match('/--FILE--\s*(.*)\s*--(EXPECTF|EXPECTREGEX|EXPECT)?--/is', $code, $r)) {
|
if (!preg_match('/--FILE--\s*(.*)\s*--(EXPECTF|EXPECTREGEX|EXPECT)?--/is', $code, $r)) {
|
||||||
// print "Unable to get code in ".$file."\n";
|
//print "Unable to get code in ".$file."\n";
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue