zoe Tue, 04 Aug 2009 21:46:19 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=286820
Log: Change to the way POST section files are created Changed paths: U php/phpruntests/trunk/src/testcase/rtPhpTest.php U php/phpruntests/trunk/src/testcase/rtTestResults.php U php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php U php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php U php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php U php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostSection.php U php/phpruntests/trunk/src/testcase/sections/rtSection.php Modified: php/phpruntests/trunk/src/testcase/rtPhpTest.php =================================================================== --- php/phpruntests/trunk/src/testcase/rtPhpTest.php 2009-08-04 21:43:16 UTC (rev 286819) +++ php/phpruntests/trunk/src/testcase/rtPhpTest.php 2009-08-04 21:46:19 UTC (rev 286820) @@ -62,7 +62,7 @@ if($this->isFileSection($sectionKey)) { $tempArray = $this->removeDone($tempArray); } - $testSection = rtSection::getInstance($sectionKey, $tempArray); + $testSection = rtSection::getInstance($sectionKey, $tempArray, $this->testName); $this->sections[$sectionKey] = $testSection; break; } else { @@ -72,7 +72,7 @@ } } - $testSection = rtSection::getInstance($lastSection, $tempArray); + $testSection = rtSection::getInstance($lastSection, $tempArray, $this->testName); $this->sections[$lastSection] = $testSection; Modified: php/phpruntests/trunk/src/testcase/rtTestResults.php =================================================================== --- php/phpruntests/trunk/src/testcase/rtTestResults.php 2009-08-04 21:43:16 UTC (rev 286819) +++ php/phpruntests/trunk/src/testcase/rtTestResults.php 2009-08-04 21:46:19 UTC (rev 286820) @@ -64,6 +64,13 @@ @unlink($this->testName . '.mem'); } } + + //always delete temporary files used in POST sections + if(file_exists($this->testName . '.post')) { + @unlink($this->testName . '.post'); + } + + } /** Modified: php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php =================================================================== --- php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php 2009-08-04 21:43:16 UTC (rev 286819) +++ php/phpruntests/trunk/src/testcase/sections/configurationsections/rtDeflatePostSection.php 2009-08-04 21:46:19 UTC (rev 286820) @@ -26,7 +26,7 @@ $this->postVariables['CONTENT_LENGTH'] = strlen($compressedPostString); $this->postVariables['REQUEST_METHOD'] = 'POST'; - $this->postFileName = tempnam(sys_get_temp_dir(), 'post'); + $this->postFileName = $this->testName . ".post"; file_put_contents($this->postFileName, $compressedPostString); } Modified: php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php =================================================================== --- php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php 2009-08-04 21:43:16 UTC (rev 286819) +++ php/phpruntests/trunk/src/testcase/sections/configurationsections/rtGzipPostSection.php 2009-08-04 21:46:19 UTC (rev 286820) @@ -26,7 +26,7 @@ $this->postVariables['CONTENT_LENGTH'] = strlen($gzipPostString); $this->postVariables['REQUEST_METHOD'] = 'POST'; - $this->postFileName = tempnam(sys_get_temp_dir(), 'post'); + $this->postFileName = $this->testName . ".post"; file_put_contents($this->postFileName, $gzipPostString); } Modified: php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php =================================================================== --- php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php 2009-08-04 21:43:16 UTC (rev 286819) +++ php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostRawSection.php 2009-08-04 21:46:19 UTC (rev 286820) @@ -36,8 +36,8 @@ $this->postVariables['CONTENT_LENGTH'] = strlen($postString); $this->postVariables['REQUEST_METHOD'] = 'POST'; - $this->postFileName = tempnam(sys_get_temp_dir(), 'post'); - + $this->postFileName = $this->testName . ".post"; + file_put_contents($this->postFileName, $postString); } Modified: php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostSection.php =================================================================== --- php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostSection.php 2009-08-04 21:43:16 UTC (rev 286819) +++ php/phpruntests/trunk/src/testcase/sections/configurationsections/rtPostSection.php 2009-08-04 21:46:19 UTC (rev 286820) @@ -24,7 +24,7 @@ $this->postVariables['CONTENT_LENGTH'] = strlen($postString); $this->postVariables['REQUEST_METHOD'] = 'POST'; - $this->postFileName = tempnam(sys_get_temp_dir(), 'post'); + $this->postFileName = $this->testName . ".post"; file_put_contents($this->postFileName, $postString); } Modified: php/phpruntests/trunk/src/testcase/sections/rtSection.php =================================================================== --- php/phpruntests/trunk/src/testcase/sections/rtSection.php 2009-08-04 21:43:16 UTC (rev 286819) +++ php/phpruntests/trunk/src/testcase/sections/rtSection.php 2009-08-04 21:46:19 UTC (rev 286820) @@ -1,7 +1,7 @@ <?php /** * rtSection - * + * * Parent class for all test sections * * @@ -42,12 +42,14 @@ protected $sectionName; protected $sectionContents; + protected $testName; protected $carriageReturnLineFeed = "\r\n"; protected $lineFeed = "\n"; - protected function __construct($sectionName, $contents) + protected function __construct($sectionName, $contents, $testName) { + $this->testName = $testName; $this->sectionName = $sectionName; $this->sectionContents = $contents; $this->init(); @@ -55,13 +57,14 @@ abstract protected function init(); - public static function getInstance($sectionName, $contents) + public static function getInstance($sectionName, $contents, $testName) { + if (!isset(self::$sectionMap[$sectionName])) { throw new rtException('Unknown section type ' . $sectionName); } - return new rtSection::$sectionMap[$sectionName]($sectionName, $contents); + return new rtSection::$sectionMap[$sectionName]($sectionName, $contents, $testName); } public function getName() @@ -73,5 +76,6 @@ { return $this->sectionContents; } + } ?>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php