zoe Tue, 21 Jul 2009 11:30:46 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=284483
Log:
Added DESCRIPTION and STDIN sections
Changed paths:
U php/phpruntests/trunk/src/rtClassMap.php
U
php/phpruntests/trunk/src/testcase/preconditions/rtIsSectionImplemented.php
U
php/phpruntests/trunk/src/testcase/preconditions/rtIsValidSectionName.php
U php/phpruntests/trunk/src/testcase/rtTestConfiguration.php
A
php/phpruntests/trunk/src/testcase/sections/configurationsections/rtStdinSection.php
U
php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php
A
php/phpruntests/trunk/src/testcase/sections/informationsections/rtDescriptionSection.php
U php/phpruntests/trunk/src/testcase/sections/rtSection.php
Modified: php/phpruntests/trunk/src/rtClassMap.php
===================================================================
--- php/phpruntests/trunk/src/rtClassMap.php 2009-07-21 10:02:26 UTC (rev 284482)
+++ php/phpruntests/trunk/src/rtClassMap.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -85,11 +85,13 @@
'rtIniSection' => 'testcase/sections/configurationsections/rtIniSection.php',
'rtPostRawSection' => 'testcase/sections/configurationsections/rtPostRawSection.php',
'rtPostSection' => 'testcase/sections/configurationsections/rtPostSection.php',
+ 'rtStdinSection' => 'testcase/sections/configurationsections/rtStdinSection.php',
'rtCleanSection' => 'testcase/sections/executablesections/rtCleanSection.php',
'rtFileExternalSection' => 'testcase/sections/executablesections/rtFileExternalSection.php',
'rtFileSection' => 'testcase/sections/executablesections/rtFileSection.php',
'rtSkipIfSection' => 'testcase/sections/executablesections/rtSkipIfSection.php',
'rtCreditsSection' => 'testcase/sections/informationsections/rtCreditsSection.php',
+ 'rtDescriptionSection' => 'testcase/sections/informationsections/rtDescriptionSection.php',
'rtTestHeaderSection' => 'testcase/sections/informationsections/rtTestHeaderSection.php',
'rtXfailSection' => 'testcase/sections/informationsections/rtXfailSection.php',
'rtExpectFSection' => 'testcase/sections/outputsections/rtExpectFSection.php',
Modified: php/phpruntests/trunk/src/testcase/preconditions/rtIsSectionImplemented.php
===================================================================
--- php/phpruntests/trunk/src/testcase/preconditions/rtIsSectionImplemented.php 2009-07-21 10:02:26 UTC (rev 284482)
+++ php/phpruntests/trunk/src/testcase/preconditions/rtIsSectionImplemented.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -17,6 +17,7 @@
{
private $sectionMap = array(
'TEST' => 'rtTestHeaderSection',
+ 'DESCRIPTION' => 'rtDescriptionSection',
'SKIPIF' => 'rtSkipIfSection',
'FILE' => 'rtFileSection',
'EXPECT' => 'rtExpectSection',
@@ -25,6 +26,7 @@
'INI' => 'rtIniSection',
'ARGS' => 'rtArgsSection',
'ENV' => 'rtEnvSection',
+ 'STDIN' => 'rtStdinSection',
'CREDITS' => 'rtCreditsSection',
'CLEAN' => 'rtCleanSection',
'XFAIL' => 'rtXfailSection',
Modified: php/phpruntests/trunk/src/testcase/preconditions/rtIsValidSectionName.php
===================================================================
--- php/phpruntests/trunk/src/testcase/preconditions/rtIsValidSectionName.php 2009-07-21 10:02:26 UTC (rev 284482)
+++ php/phpruntests/trunk/src/testcase/preconditions/rtIsValidSectionName.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -17,6 +17,7 @@
{
private $validSectionNames = array(
'TEST',
+ 'DESCRIPTION',
'SKIPIF',
'FILE',
'FILEEOF',
@@ -27,6 +28,7 @@
'INI',
'ARGS',
'ENV',
+ 'STDIN',
'XFAIL',
'STDIN',
'CREDITS',
Modified: php/phpruntests/trunk/src/testcase/rtTestConfiguration.php
===================================================================
--- php/phpruntests/trunk/src/testcase/rtTestConfiguration.php 2009-07-21 10:02:26 UTC (rev 284482)
+++ php/phpruntests/trunk/src/testcase/rtTestConfiguration.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -20,6 +20,7 @@
private $testCommandLineArguments;
private $phpExecutable;
private $inputFileString;
+ private $stdin = null;
private $cgiTest = false;
private $cgiSections = array(
'GET',
@@ -45,6 +46,7 @@
$this->setTestCommandLineArguments($sections);
$this->setPhpExecutable($runConfiguration, $sectionHeadings);
$this->setInputFileString($runConfiguration, $sections, $sectionHeadings);
+ $this->setStdin($sections, $sectionHeadings);
}
@@ -143,6 +145,12 @@
$this->cgiTest = true;
}
}
+
+ private function setStdin($sections, $sectionHeadings) {
+ if(in_array('STDIN', $sectionHeadings)) {
+ $this->stdin = $sections['STDIN']->getInputString();
+ }
+ }
public function getPhpExecutable()
{
@@ -169,6 +177,11 @@
{
return $this->inputFileString;
}
+
+ public function getStdin()
+ {
+ return $this->stdin;
+ }
public function isCgiTest()
{
Added: php/phpruntests/trunk/src/testcase/sections/configurationsections/rtStdinSection.php
===================================================================
--- php/phpruntests/trunk/src/testcase/sections/configurationsections/rtStdinSection.php (rev 0)
+++ php/phpruntests/trunk/src/testcase/sections/configurationsections/rtStdinSection.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -0,0 +1,30 @@
+<?php
+/**
+ * rtStdinSection
+ *
+ * Make section content stdin for the test case
+ *
+ * @category Testing
+ * @package RUNTESTS
+ * @author Zoe Slattery <z...@php.net>
+ * @author Stefan Priebsch <sprieb...@php.net>
+ * @copyright 2009 The PHP Group
+ * @license http://www.php.net/license/3_01.txt PHP License 3.01
+ * @link http://qa.php.net/
+ *
+ */
+class rtStdinSection extends rtConfigurationSection
+{
+ private $inputString;
+
+ protected function init()
+ {
+ $this->inputString = join($this->sectionContents, PHP_EOL) . clPHP_EOL;
+ }
+
+ public function getInputString() {
+ return $this->inputString;
+ }
+
+}
+?>
Modified: php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php
===================================================================
--- php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php 2009-07-21 10:02:26 UTC (rev 284482)
+++ php/phpruntests/trunk/src/testcase/sections/executablesections/rtFileSection.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -49,7 +49,8 @@
$PhpRunner = new rtPhpRunner($phpCommand,
$testCase->testConfiguration->getEnvironmentVariables(),
- $runConfiguration->getSetting('WorkingDirectory')
+ $runConfiguration->getSetting('WorkingDirectory'),
+ $testCase->testConfiguration->getStdin()
);
try {
Added: php/phpruntests/trunk/src/testcase/sections/informationsections/rtDescriptionSection.php
===================================================================
--- php/phpruntests/trunk/src/testcase/sections/informationsections/rtDescriptionSection.php (rev 0)
+++ php/phpruntests/trunk/src/testcase/sections/informationsections/rtDescriptionSection.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -0,0 +1,18 @@
+<?php
+/**
+ * rtDescriptionSection
+ *
+ * Deals with information in test credits section
+ *
+ * @category Testing
+ * @package RUNTESTS
+ * @author Zoe Slattery <z...@php.net>
+ * @author Stefan Priebsch <sprieb...@php.net>
+ * @copyright 2009 The PHP Group
+ * @license http://www.php.net/license/3_01.txt PHP License 3.01
+ * @link http://qa.php.net/
+ */
+class rtDescriptionSection extends rtInformationSection
+{
+}
+?>
Modified: php/phpruntests/trunk/src/testcase/sections/rtSection.php
===================================================================
--- php/phpruntests/trunk/src/testcase/sections/rtSection.php 2009-07-21 10:02:26 UTC (rev 284482)
+++ php/phpruntests/trunk/src/testcase/sections/rtSection.php 2009-07-21 11:30:46 UTC (rev 284483)
@@ -17,6 +17,7 @@
{
private static $sectionMap = array (
'TEST' => 'rtTestHeaderSection',
+ 'DESCRIPTION' => 'rtDescriptionSection',
'SKIPIF' => 'rtSkipIfSection',
'FILE' => 'rtFileSection',
'EXPECT' => 'rtExpectSection',
@@ -25,6 +26,7 @@
'INI' => 'rtIniSection',
'ARGS' => 'rtArgsSection',
'ENV' => 'rtEnvSection',
+ 'STDIN' => 'rtStdinSection',
'CREDITS' => 'rtCreditsSection',
'CLEAN' => 'rtCleanSection',
'XFAIL' => 'rtXfailSection',
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php