com phpruntests: Catch empty section at end of test: src/testcase/preconditions/rtHasNoEmptySections.php
| From: | Zoe Slattery | Date: | Wed, 16 May 2012 17:49:04 +0000 |
| Subject: | com phpruntests: Catch empty section at end of test: src/testcase/preconditions/rtHasNoEmptySections.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66562@lists.php.net to get a copy of this message | ||
Commit: b4a18c30ccd0643a5ab43c39d7a521250a2dda7a
Author: zoe slattery <zoe@php.net> Wed, 16 May 2012 18:49:04 +0100
Parents: 53e9743eceb770fa759cb80fcf634a203053e53b
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=b4a18c30ccd0643a5ab43c39d7a521250a2dda7a
Log:
Catch empty section at end of test
Changed paths:
M src/testcase/preconditions/rtHasNoEmptySections.php
Diff:
diff --git a/src/testcase/preconditions/rtHasNoEmptySections.php
b/src/testcase/preconditions/rtHasNoEmptySections.php
index 9206ded..5007f66 100644
--- a/src/testcase/preconditions/rtHasNoEmptySections.php
+++ b/src/testcase/preconditions/rtHasNoEmptySections.php
@@ -37,8 +37,8 @@ class rtHasNoEmptySections implements rtTestPreCondition
*/
public function isMet(array $testContents, array $sectionHeaders)
{
-
-
+ //TODO: This won't catch a section full of blank lines.
+ //It prabably should :-(
for ($i=0; $i<count($testContents) - 1; $i++) {
$nextLine = $testContents[$i+1];
$thisLine = $testContents[$i];
@@ -48,6 +48,14 @@ class rtHasNoEmptySections implements rtTestPreCondition
}
}
}
+
+ //Catch an empty section at the end
+ if($this->isSectionHeading($thisLine)) {
+ if($nextLine == ""){
+ return false;
+ }
+ }
+
return true;
}
}