com phpruntests: remove unnecessary check: src/testcase/rtPhpTest.php

From: Date: Sat, 18 Jul 2009 17:38:12 +0000
Subject: com phpruntests: remove unnecessary check: src/testcase/rtPhpTest.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-66327@lists.php.net to get a copy of this message
Commit: 75797b24db2ebc9d84db9e5ee0f4a6d21bcfa1b6 Author: Zoe Slattery <zoe@php.net> Sat, 18 Jul 2009 17:38:12 +0000 Parents: d27e6fbd85b3c729716bf370125d3da47365d3ac Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=75797b24db2ebc9d84db9e5ee0f4a6d21bcfa1b6 Log: remove unnecessary check Changed paths: M src/testcase/rtPhpTest.php Diff: diff --git a/src/testcase/rtPhpTest.php b/src/testcase/rtPhpTest.php index ddcf082..c18cc4a 100644 --- a/src/testcase/rtPhpTest.php +++ b/src/testcase/rtPhpTest.php @@ -42,7 +42,7 @@ class rtPhpTest { $lastSection = end($this->sectionHeadings); $start=0; - + foreach($this->sectionHeadings as $keyNumber => $sectionKey) { if($keyNumber < count($this->sectionHeadings) - 1) { @@ -53,20 +53,17 @@ class rtPhpTest for($index=$start; $index<count($this->contents); $index++) if($this->contents[$index] == "--".$sectionKey."--") { //Found the beginning of the section - + for($contentsLine=$index + 1; $contentsLine<count($this->contents); $contentsLine ++) { - + if( ($this->contents[$contentsLine] == "--".$nextKey."--") || ($contentsLine == count($this->contents))) { //Found the end of the section OR the end of the test $start = $contentsLine - 1; if($this->isFileSection($sectionKey)) { $tempArray = $this->removeDone($tempArray); - } - - if(count($tempArray) > 0) { - $testSection = rtSection::getInstance($sectionKey, $tempArray); - $this->sections[$sectionKey] = $testSection; - } + } + $testSection = rtSection::getInstance($sectionKey, $tempArray); + $this->sections[$sectionKey] = $testSection; break; } else { $tempArray[] = $this->contents[$contentsLine]; @@ -183,7 +180,7 @@ class rtPhpTest $result = array(); foreach($array as $line) { $result[] = $line; - // If found at the start of the line, so ' ===done===' won't work. + // If found at the start of the line, so ' ===done===' won't work. if(stripos($line, "===done===") === 0) { break; }

« previous php.qa (#66327) next »