com phpruntests: change to use protected rather than private: src/configuration/preconditions/rtIsPhpVersionCorrect.php
src/configuration/rtEnvironmentVariables.php src/configuration/rtRuntestsConfiguration.php src/configuration/settings/rtCurrentDirectorySetting.php
src/configuration/settings/rtLogFormatSetting.php src/configuration/settings/rtPhpCgiExecutableSetting.php
src/configuration/settings/rtPhpCommandLineArgSetting.php src/configuration
| From: | David Soria Parra | Date: | Thu, 06 Aug 2009 11:48:12 +0000 |
| Subject: | com phpruntests: change to use protected rather than private: src/configuration/preconditions/rtIsPhpVersionCorrect.php src/configuration/rtEnvironmentVariables.php src/configuration/rtRuntestsConfiguration.php src/configuration/settings/rtCurrentDirectorySetting.php src/configuration/settings/rtLogFormatSetting.php src/configuration/settings/rtPhpCgiExecutableSetting.php src/configuration/settings/rtPhpCommandLineArgSetting.php src/configuration |
||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66299@lists.php.net to get a copy of this message | ||
Commit: ec4c24802e707706087f4a7cf4e818198815136f
Author: Zoe Slattery <zoe@php.net> Thu, 6 Aug 2009 11:48:12 +0000
Parents: 9f971feb49bca84ce2996910b45dcc6aaebba102
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=ec4c24802e707706087f4a7cf4e818198815136f
Log:
change to use protected rather than private
Changed paths:
M src/configuration/preconditions/rtIsPhpVersionCorrect.php
M src/configuration/rtEnvironmentVariables.php
M src/configuration/rtRuntestsConfiguration.php
M src/configuration/settings/rtCurrentDirectorySetting.php
M src/configuration/settings/rtLogFormatSetting.php
M src/configuration/settings/rtPhpCgiExecutableSetting.php
M src/configuration/settings/rtPhpCommandLineArgSetting.php
M src/configuration/settings/rtPhpExecutableSetting.php
M src/configuration/settings/rtTestDirectorySetting.php
M src/configuration/settings/rtTestFileSetting.php
M src/configuration/settings/rtWorkingDirectorySetting.php
M src/taskScheduler/rtTaskSchedulerFile.php
M src/taskScheduler/rtTaskSchedulerMsgQ.php
M src/taskScheduler/rtTaskTestGroup.php
M src/testcase/output/rtTestOutputWriterHTML.php
M src/testcase/output/rtTestOutputWriterXML.php
M src/testcase/preconditions/rtHasNoEmptySections.php
M src/testcase/preconditions/rtIsSectionImplemented..php
M src/testcase/preconditions/rtIsValidSectionName.php
M src/testcase/rtPhpRunner.php
M src/testcase/rtPhpTest.php
M src/testcase/rtPhpTestFile.php
M src/testcase/rtTestConfiguration.php
M src/testcase/rtTestDifference.php
M src/testcase/rtTestResults.php
M src/testcase/rtTestStatus.php
M src/testcase/sections/configurationsections/rtArgsSection.php
M src/testcase/sections/configurationsections/rtCookieSection.php
M src/testcase/sections/configurationsections/rtDeflatePostSection.php
M src/testcase/sections/configurationsections/rtEnvSection.php
M src/testcase/sections/configurationsections/rtGetSection.php
M src/testcase/sections/configurationsections/rtGzipPostSection.php
M src/testcase/sections/configurationsections/rtIniSection.php
M src/testcase/sections/configurationsections/rtPostRawSection.php
M src/testcase/sections/configurationsections/rtPostSection.php
M src/testcase/sections/configurationsections/rtStdinSection.php
M src/testcase/sections/executablesections/rtFileExternalSection.php
M src/testcase/sections/executablesections/rtFileSection.php
M src/testcase/sections/outputsections/rtExpectFSection.php
M src/testcase/sections/rtSection.php
M src/testgroup/rtPhpTestGroup.php
M src/testrun/rtPhpTestRun.php
diff --git a/src/configuration/preconditions/rtIsPhpVersionCorrect.php b/src/configuration/preconditions/rtIsPhpVersionCorrect.php index c730b67..3f635e5 100644 --- a/src/configuration/preconditions/rtIsPhpVersionCorrect.php +++ b/src/configuration/preconditions/rtIsPhpVersionCorrect.php @@ -19,12 +19,12 @@ class rtIsPhpVersionCorrect extends rtPreCondition /** * @var int */ - private $requiredMajorVersion = 5; + protected $requiredMajorVersion = 5; /** * @var int */ - private $requiredMinorVersion = 3; + protected $requiredMinorVersion = 3; /** * Return the message associated with an invalid php-version diff --git a/src/configuration/rtEnvironmentVariables.php b/src/configuration/rtEnvironmentVariables.php index deafa0b..8069211 100644 --- a/src/configuration/rtEnvironmentVariables.php +++ b/src/configuration/rtEnvironmentVariables.php @@ -31,7 +31,7 @@ class rtEnvironmentVariables 'NO_PHPTEST_SUMMARY', ); - private $environmentVariables = array(); + protected $environmentVariables = array(); public function __construct() { diff --git a/src/configuration/rtRuntestsConfiguration.php b/src/configuration/rtRuntestsConfiguration.php index 62b7e9c..7d531bd 100644 --- a/src/configuration/rtRuntestsConfiguration.php +++ b/src/configuration/rtRuntestsConfiguration.php @@ -19,13 +19,13 @@ abstract class rtRuntestsConfiguration { protected $commandLineArgs; - private $settings; - private $environmentVariables; - private $commandLine; + protected $settings; + protected $environmentVariables; + protected $commandLine; - private $memoryTool = null; + protected $memoryTool = null; - private $settingNames = array ( + protected $settingNames = array ( 'CurrentDirectory' => 'rtCurrentDirectorySetting', 'WorkingDirectory' => 'rtWorkingDirectorySetting', diff --git a/src/configuration/settings/rtCurrentDirectorySetting.php b/src/configuration/settings/rtCurrentDirectorySetting.php index b041a9d..cba3d46 100644 --- a/src/configuration/settings/rtCurrentDirectorySetting.php +++ b/src/configuration/settings/rtCurrentDirectorySetting.php @@ -15,7 +15,7 @@ */ class rtCurrentDirectorySetting extends rtSetting { - private $currentDirectory; + protected $currentDirectory; /** * Set the current directory diff --git a/src/configuration/settings/rtLogFormatSetting.php b/src/configuration/settings/rtLogFormatSetting.php index 29cfe25..9fdd821 100644 --- a/src/configuration/settings/rtLogFormatSetting.php +++ b/src/configuration/settings/rtLogFormatSetting.php @@ -19,7 +19,7 @@ */ class rtLogFormatSetting extends rtSetting { - private $logFormat; + protected $logFormat; /** * Sets log format to that specifiled by TEST_PHP_LOG_FORMAT or LEOD diff --git a/src/configuration/settings/rtPhpCgiExecutableSetting.php b/src/configuration/settings/rtPhpCgiExecutableSetting.php index 2d1c141..db81b0d 100644 --- a/src/configuration/settings/rtPhpCgiExecutableSetting.php +++ b/src/configuration/settings/rtPhpCgiExecutableSetting.php @@ -17,9 +17,9 @@ class rtPhpCgiExecutableSetting extends rtSetting { const SAPI_CGI = "/sapi/cgi/php-cgi"; - private $phpCgiExecutable; + protected $phpCgiExecutable; - private $configuration; + protected $configuration; /** * Sets the PHP CGI executable. Note the dependency on having a working directory setting diff --git a/src/configuration/settings/rtPhpCommandLineArgSetting.php b/src/configuration/settings/rtPhpCommandLineArgSetting.php index b18fa99..dc1cf1c 100644 --- a/src/configuration/settings/rtPhpCommandLineArgSetting.php +++ b/src/configuration/settings/rtPhpCommandLineArgSetting.php @@ -16,7 +16,7 @@ */ class rtPhpCommandLineArgSetting extends rtSetting { - private $phpCommandLineArguments; + protected $phpCommandLineArguments; /** * Sets the command line arguments for diff --git a/src/configuration/settings/rtPhpExecutableSetting.php b/src/configuration/settings/rtPhpExecutableSetting.php index bc2a36b..99dd693 100644 --- a/src/configuration/settings/rtPhpExecutableSetting.php +++ b/src/configuration/settings/rtPhpExecutableSetting.php @@ -17,7 +17,7 @@ class rtPhpExecutableSetting extends rtSetting { const SAPI_CLI = "/sapi/cli/php"; - private $phpExecutable; + protected $phpExecutable; /** * Sets the PHP executable, note the dependency on working directory diff --git a/src/configuration/settings/rtTestDirectorySetting.php b/src/configuration/settings/rtTestDirectorySetting.php index fde918c..f2cce9f 100644 --- a/src/configuration/settings/rtTestDirectorySetting.php +++ b/src/configuration/settings/rtTestDirectorySetting.php @@ -17,7 +17,7 @@ */ class rtTestDirectorySetting extends rtSetting { - private $testDir = null; + protected $testDir = null; /** * Check each option - if it's a directory add it to the list. diff --git a/src/configuration/settings/rtTestFileSetting.php b/src/configuration/settings/rtTestFileSetting.php index 69104ec..d6e747f 100644 --- a/src/configuration/settings/rtTestFileSetting.php +++ b/src/configuration/settings/rtTestFileSetting.php @@ -17,7 +17,7 @@ */ class rtTestFileSetting extends rtSetting { - private $testFiles; + protected $testFiles; /** * Check each filename - if it's not a directory and the name ends .phpt diff --git a/src/configuration/settings/rtWorkingDirectorySetting.php b/src/configuration/settings/rtWorkingDirectorySetting.php index 9c36178..b715245 100644 --- a/src/configuration/settings/rtWorkingDirectorySetting.php +++ b/src/configuration/settings/rtWorkingDirectorySetting.php @@ -16,7 +16,7 @@ */ class rtWorkingDirectorySetting extends rtSetting { - private $workingDirectory; + protected $workingDirectory; /** * Sets the working directory diff --git a/src/taskScheduler/rtTaskSchedulerFile.php b/src/taskScheduler/rtTaskSchedulerFile.php index 993e95f..7f98828 100644 --- a/src/taskScheduler/rtTaskSchedulerFile.php +++ b/src/taskScheduler/rtTaskSchedulerFile.php @@ -17,8 +17,8 @@ class rtTaskSchedulerFile extends rtTaskScheduler { const TMP_FILE = 'taskFile'; - private $pidStore = array(); // stores the pids of all child-processes - private $groupTasks = false; // are the tasks stored in groups? + protected $pidStore = array(); // stores the pids of all child-processes + protected $groupTasks = false; // are the tasks stored in groups? /** @@ -140,7 +140,7 @@ class rtTaskSchedulerFile extends rtTaskScheduler * creates a temporary file for each child which stores serialized task-objects * */ - private function distributeTasks() { + protected function distributeTasks() { if ($this->groupTasks == true) { @@ -170,7 +170,7 @@ class rtTaskSchedulerFile extends rtTaskScheduler * * @return void */ - private function receiver() + protected function receiver() { for ($cid=0; $cid<$this->processCount; $cid++) { @@ -202,7 +202,7 @@ class rtTaskSchedulerFile extends rtTaskScheduler * @param int $cid the child-id * @return void */ - private function child($cid) + protected function child($cid) { $taskList = file_get_contents(self::TMP_FILE.$cid); $taskList = explode('[END]', $taskList); diff --git a/src/taskScheduler/rtTaskSchedulerMsgQ.php b/src/taskScheduler/rtTaskSchedulerMsgQ.php index 14dd2b4..5845dd0 100644 --- a/src/taskScheduler/rtTaskSchedulerMsgQ.php +++ b/src/taskScheduler/rtTaskSchedulerMsgQ.php @@ -21,9 +21,9 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler const MSG_QUEUE_SIZE = 1024; // max-size of a single message const KILL_CHILD = 'killBill'; // kill-signal to terminate a child - private $inputQueue = NULL; // the input-queue (only used by the sender) - private $pidStore = array(); // stores the pids of all child-processes - private $groupTasks = false; // are the tasks stored in groups? + protected $inputQueue = NULL; // the input-queue (only used by the sender) + protected $pidStore = array(); // stores the pids of all child-processes + protected $groupTasks = false; // are the tasks stored in groups? @@ -70,7 +70,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler /** * removes the used message-queues. */ - private static function cleanUp() + protected static function cleanUp() { @msg_remove_queue(msg_get_queue(self::MSG_QUEUE_KEY)); @msg_remove_queue(msg_get_queue(self::MSG_QUEUE_KEY+1)); @@ -174,7 +174,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * * @return void */ - private function receiver() + protected function receiver() { $resultQueue = msg_get_queue(self::MSG_QUEUE_KEY+1); @@ -241,7 +241,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * * @return void */ - private function sender() + protected function sender() { $this->inputQueue = msg_get_queue(self::MSG_QUEUE_KEY); @@ -273,7 +273,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * @param int $type the message-type (default=1) * @return void */ - private function sendTask(task $task, $index, $type=1) + protected function sendTask(task $task, $index, $type=1) { $task->setIndex($index); @@ -297,7 +297,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * @param int $cid the child-id (default=NULL) * @return void */ - private function child($cid=NULL) + protected function child($cid=NULL) { if (is_null($cid)) { $cid = 0; diff --git a/src/taskScheduler/rtTaskTestGroup.php b/src/taskScheduler/rtTaskTestGroup.php index 89c5b9a..078a10c 100644 --- a/src/taskScheduler/rtTaskTestGroup.php +++ b/src/taskScheduler/rtTaskTestGroup.php @@ -13,8 +13,8 @@ */ class rtTaskTestGroup extends rtTask implements rtTaskInterface { - private $runConfiguration; - private $subDirectory; + protected $runConfiguration; + protected $subDirectory; public function __construct($runConfiguration, $subDirectory) diff --git a/src/testcase/output/rtTestOutputWriterHTML.php b/src/testcase/output/rtTestOutputWriterHTML.php index 8d0d51b..b4e6e3d 100644 --- a/src/testcase/output/rtTestOutputWriterHTML.php +++ b/src/testcase/output/rtTestOutputWriterHTML.php @@ -16,8 +16,8 @@ */ class rtTestOutputWriterHTML extends rtTestOutputWriter { - private $dom = null; - private $stage = null; // base-node which holds the content + protected $dom = null; + protected $stage = null; // base-node which holds the content public function __construct() diff --git a/src/testcase/output/rtTestOutputWriterXML.php b/src/testcase/output/rtTestOutputWriterXML.php index e284faf..daa54de 100644 --- a/src/testcase/output/rtTestOutputWriterXML.php +++ b/src/testcase/output/rtTestOutputWriterXML.php @@ -16,8 +16,8 @@ */ class rtTestOutputWriterXML extends rtTestOutputWriter { - private $dom = null; - private $rootNode = null; + protected $dom = null; + protected $rootNode = null; public function __construct() diff --git a/src/testcase/preconditions/rtHasNoEmptySections.php b/src/testcase/preconditions/rtHasNoEmptySections.php index ba7b76b..9206ded 100644 --- a/src/testcase/preconditions/rtHasNoEmptySections.php +++ b/src/testcase/preconditions/rtHasNoEmptySections.php @@ -15,7 +15,7 @@ */ class rtHasNoEmptySections implements rtTestPreCondition { - private function isSectionHeading($string) { + protected function isSectionHeading($string) { return preg_match("/^--[A-Z]+(_[A-Z]+|)--/", $string); } diff --git a/src/testcase/preconditions/rtIsSectionImplemented.php b/src/testcase/preconditions/rtIsSectionImplemented.php index f2621d6..278ddb7 100644 --- a/src/testcase/preconditions/rtIsSectionImplemented.php +++ b/src/testcase/preconditions/rtIsSectionImplemented.php @@ -15,7 +15,7 @@ */ class rtIsSectionImplemented implements rtTestPreCondition { - private $sectionMap = array( + protected $sectionMap = array( 'TEST' => 'rtTestHeaderSection', 'DESCRIPTION' => 'rtDescriptionSection', 'SKIPIF' => 'rtSkipIfSection', diff --git a/src/testcase/preconditions/rtIsValidSectionName.php b/src/testcase/preconditions/rtIsValidSectionName.php index d08e916..e8159cb 100644 --- a/src/testcase/preconditions/rtIsValidSectionName.php +++ b/src/testcase/preconditions/rtIsValidSectionName.php @@ -15,7 +15,7 @@ */ class rtIsValidSectionName implements rtTestPreCondition { - private $validSectionNames = array( + protected $validSectionNames = array( 'TEST', 'DESCRIPTION', 'SKIPIF', diff --git a/src/testcase/rtPhpRunner.php b/src/testcase/rtPhpRunner.php index 8ddb058..6b56c1f 100644 --- a/src/testcase/rtPhpRunner.php +++ b/src/testcase/rtPhpRunner.php @@ -15,11 +15,11 @@ */ class rtPhpRunner { - private $phpCommand; - private $environmentVariables; - private $currentWorkingDirectory; - private $stdin; - private $timeOut; + protected $phpCommand; + protected $environmentVariables; + protected $currentWorkingDirectory; + protected $stdin; + protected $timeOut; public function __construct($phpCommand, $environmentVariables=null, $currentWorkingDirectory=null, $stdin = null, $timeOut = 60) { diff --git a/src/testcase/rtPhpTest.php b/src/testcase/rtPhpTest.php index 0acb168..785bf3e 100644 --- a/src/testcase/rtPhpTest.php +++ b/src/testcase/rtPhpTest.php @@ -16,14 +16,14 @@ class rtPhpTest { public $testConfiguration; - private $testName; - private $contents; - private $testStatus; - private $output; - private $sections; - private $fileSection; - private $expectSection; - private $sectionHeadings; + protected $testName; + protected $contents; + protected $testStatus; + protected $output; + protected $sections; + protected $fileSection; + protected $expectSection; + protected $sectionHeadings; public function __construct(array $contents, $testName, $sectionHeadings, $runConfiguration, $testStatus) { @@ -164,7 +164,7 @@ class rtPhpTest * Identify a FILE section * */ - private function isFileSection($key) + protected function isFileSection($key) { if (strpos($key, "FILE") !== false) { return true; @@ -176,7 +176,7 @@ class rtPhpTest /* * Strip the lines after ===DONE=== from the file section of a test */ - private function removeDone($array) { + protected function removeDone($array) { $result = array(); foreach($array as $line) { $result[] = $line; @@ -192,7 +192,7 @@ class rtPhpTest /** * Set the test's file section */ - private function setFileSection() + protected function setFileSection() { if (array_key_exists('FILE', $this->sections)) { return $this->sections['FILE']; @@ -211,7 +211,7 @@ class rtPhpTest /** * Sets the test's expect section */ - private function setExpectSection() + protected function setExpectSection() { if (array_key_exists('EXPECT', $this->sections)) { return $this->sections['EXPECT']; diff --git a/src/testcase/rtPhpTestFile.php b/src/testcase/rtPhpTestFile.php index dfc9de7..07a0e93 100644 --- a/src/testcase/rtPhpTestFile.php +++ b/src/testcase/rtPhpTestFile.php @@ -14,16 +14,16 @@ */ class rtPhpTestFile { - private $fileName; - private $testName; - private $testContents; - private $testExitMessage; - private $sectionHeadings = array(); + protected $fileName; + protected $testName; + protected $testContents; + protected $testExitMessage; + protected $sectionHeadings = array(); - private $carriageReturn = "\r"; - private $newLine = "\n"; + protected $carriageReturn = "\r"; + protected $newLine = "\n"; - private $preConditions = array ( + protected $preConditions = array ( 'rtHasMandatorySections', 'rtHasNoDuplicateSections', 'rtIsValidSectionName', @@ -31,16 +31,16 @@ class rtPhpTestFile 'rtHasNoEmptySections', ); - private function isSectionHeading($string) { + protected function isSectionHeading($string) { return preg_match("/^\s*--[A-Z]+(_[A-Z]+|)--/", $string); } - private function getUntrimmedSectionHeading($string) { + protected function getUntrimmedSectionHeading($string) { preg_match("/^\s*(--[A-Z]+(_[A-Z]+|)--)/", $string, $matches); return $matches[1]; } - private function getSectionHeading($string) { + protected function getSectionHeading($string) { preg_match("/^\s*--([A-Z]+(_[A-Z]+|))--/", $string, $matches); return $matches[1]; } diff --git a/src/testcase/rtTestConfiguration.php b/src/testcase/rtTestConfiguration.php index dbd1f37..44abeb2 100644 --- a/src/testcase/rtTestConfiguration.php +++ b/src/testcase/rtTestConfiguration.php @@ -15,14 +15,14 @@ */ class rtTestConfiguration { - private $environmentVariables; - private $phpCommandLineArguments; - private $testCommandLineArguments; - private $phpExecutable; - private $inputFileString; - private $stdin = null; - private $cgiTest = false; - private $cgiSections = array( + protected $environmentVariables; + protected $phpCommandLineArguments; + protected $testCommandLineArguments; + protected $phpExecutable; + protected $inputFileString; + protected $stdin = null; + protected $cgiTest = false; + protected $cgiSections = array( 'GET', 'POST', 'POST_RAW', @@ -37,7 +37,7 @@ class rtTestConfiguration $this->init($runConfiguration, $sections, $sectionHeadings, $fileSection); } - private function init(rtRuntestsConfiguration $runConfiguration, $sections, $sectionHeadings, $fileSection) + protected function init(rtRuntestsConfiguration $runConfiguration, $sections, $sectionHeadings, $fileSection) { $this->setCgiTest($sectionHeadings); @@ -50,7 +50,7 @@ class rtTestConfiguration } - private function setEnvironmentVariables(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) + protected function setEnvironmentVariables(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) { $this->environmentVariables = $runConfiguration->getEnvironmentVariables(); @@ -88,7 +88,7 @@ class rtTestConfiguration } - private function setPhpCommandLineArguments(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) + protected function setPhpCommandLineArguments(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) { $this->phpCommandLineArguments = $runConfiguration->getSetting('PhpCommandLineArguments'); if (array_key_exists('INI', $sections)) { @@ -99,7 +99,7 @@ class rtTestConfiguration } } - private function setTestCommandLineArguments($sections) + protected function setTestCommandLineArguments($sections) { $this->testCommandLineArguments = ''; @@ -108,7 +108,7 @@ class rtTestConfiguration } } - private function setPhpExecutable($runConfiguration, $sectionHeadings) + protected function setPhpExecutable($runConfiguration, $sectionHeadings) { if ($this->cgiTest) { if($runConfiguration->getSetting('PhpCgiExecutable') != null) { @@ -121,7 +121,7 @@ class rtTestConfiguration } } - private function setInputFileString($runConfiguration, $sections, $sectionHeadings) + protected function setInputFileString($runConfiguration, $sections, $sectionHeadings) { $this->inputFileString = ''; if(in_array('POST', $sectionHeadings)) { @@ -138,7 +138,7 @@ class rtTestConfiguration } } - private function setCgiTest($sectionHeadings) + protected function setCgiTest($sectionHeadings) { $tempArray = array_diff($this->cgiSections, $sectionHeadings); if (count($tempArray) < count($this->cgiSections)) { @@ -146,7 +146,7 @@ class rtTestConfiguration } } - private function setStdin($sections, $sectionHeadings) { + protected function setStdin($sections, $sectionHeadings) { if(in_array('STDIN', $sectionHeadings)) { $this->stdin = $sections['STDIN']->getInputString(); } diff --git a/src/testcase/rtTestDifference.php b/src/testcase/rtTestDifference.php index 1471dec..f1ebcd4 100644 --- a/src/testcase/rtTestDifference.php +++ b/src/testcase/rtTestDifference.php @@ -15,10 +15,10 @@ */ class rtTestDifference { - private $difference; - private $expectedOutput; - private $output; - private $expectedRegularExpression; + protected $difference; + protected $expectedOutput; + protected $output; + protected $expectedRegularExpression; public function __construct(rtOutputSection $expectedOutput, $output) { diff --git a/src/testcase/rtTestResults.php b/src/testcase/rtTestResults.php index ca6fe3d..3f7e6c8 100644 --- a/src/testcase/rtTestResults.php +++ b/src/testcase/rtTestResults.php @@ -19,11 +19,11 @@ */ class rtTestResults { - private $testStatus; - private $testName = ''; - private $savedFileNames = array(); - private $title = ''; - private $time = 0; + protected $testStatus; + protected $testName = ''; + protected $savedFileNames = array(); + protected $title = ''; + protected $time = 0; public function __construct(rtPhpTest $testCase = null, rtTestStatus $testStatus = null) { @@ -76,7 +76,7 @@ class rtTestResults /** * Actions if a test passes */ - private function onPass(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) + protected function onPass(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { if (!$runConfiguration->hasCommandLineOption('keep-all') && !$runConfiguration->hasCommandLineOption('keep-php')) { $testCase->getFileSection()->deleteFile(); @@ -115,7 +115,7 @@ class rtTestResults } - private function onFail(rtPhpTest $testCase) + protected function onFail(rtPhpTest $testCase) { $testDifference = new rtTestDifference($testCase->getExpectSection(), $testCase->getOutput()); $difference = implode(b"\n",$testDifference->getDifference()); @@ -148,7 +148,7 @@ class rtTestResults } } - private function onSkip(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) + protected function onSkip(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { if ($runConfiguration->hasCommandLineOption('keep-all') || $runConfiguration->hasCommandLineOption('keep-skip')) { $this->savedFileNames['skipif'] = $this->testName. 'skipif.php'; diff --git a/src/testcase/rtTestStatus.php b/src/testcase/rtTestStatus.php index 997beec..793ba75 100644 --- a/src/testcase/rtTestStatus.php +++ b/src/testcase/rtTestStatus.php @@ -14,10 +14,10 @@ */ class rtTestStatus { - private $testName; - private $states = array(); - private $messages = array(); - private $testStateNames = array ('skip', + protected $testName; + protected $states = array(); + protected $messages = array(); + protected $testStateNames = array ('skip', 'bork', 'warn', 'xfail', @@ -35,7 +35,7 @@ class rtTestStatus { $this->init(); } - private function init() + protected function init() { foreach ($this->testStateNames as $name) { $this->states[$name] = false; diff --git a/src/testcase/sections/configurationsections/rtArgsSection.php b/src/testcase/sections/configurationsections/rtArgsSection.php index 584be57..bfee825 100644 --- a/src/testcase/sections/configurationsections/rtArgsSection.php +++ b/src/testcase/sections/configurationsections/rtArgsSection.php @@ -15,7 +15,7 @@ */ class rtArgsSection extends rtConfigurationSection { - private $testCommandLineArguments; + protected $testCommandLineArguments; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtCookieSection.php b/src/testcase/sections/configurationsections/rtCookieSection.php index 0c57725..3501fba 100644 --- a/src/testcase/sections/configurationsections/rtCookieSection.php +++ b/src/testcase/sections/configurationsections/rtCookieSection.php @@ -14,7 +14,7 @@ */ class rtCookieSection extends rtConfigurationSection { - private $cookieVariables = array(); + protected $cookieVariables = array(); protected function init() { diff --git a/src/testcase/sections/configurationsections/rtDeflatePostSection.php b/src/testcase/sections/configurationsections/rtDeflatePostSection.php index c944fb2..c314f76 100644 --- a/src/testcase/sections/configurationsections/rtDeflatePostSection.php +++ b/src/testcase/sections/configurationsections/rtDeflatePostSection.php @@ -14,8 +14,8 @@ */ class rtDeflatePostSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtEnvSection.php b/src/testcase/sections/configurationsections/rtEnvSection.php index 8b6430c..f55f314 100644 --- a/src/testcase/sections/configurationsections/rtEnvSection.php +++ b/src/testcase/sections/configurationsections/rtEnvSection.php @@ -15,7 +15,7 @@ */ class rtEnvSection extends rtConfigurationSection { - private $testEnvironmentVariables = array(); + protected $testEnvironmentVariables = array(); protected function init() { diff --git a/src/testcase/sections/configurationsections/rtGetSection.php b/src/testcase/sections/configurationsections/rtGetSection.php index 420ac5a..91c4c7b 100644 --- a/src/testcase/sections/configurationsections/rtGetSection.php +++ b/src/testcase/sections/configurationsections/rtGetSection.php @@ -14,7 +14,7 @@ */ class rtGetSection extends rtConfigurationSection { - private $getVariables = array(); + protected $getVariables = array(); protected function init() { diff --git a/src/testcase/sections/configurationsections/rtGzipPostSection.php b/src/testcase/sections/configurationsections/rtGzipPostSection.php index bbe015d..778691a 100644 --- a/src/testcase/sections/configurationsections/rtGzipPostSection.php +++ b/src/testcase/sections/configurationsections/rtGzipPostSection.php @@ -14,8 +14,8 @@ */ class rtGzipPostSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtIniSection.php b/src/testcase/sections/configurationsections/rtIniSection.php index 549b5fe..82a7adc 100644 --- a/src/testcase/sections/configurationsections/rtIniSection.php +++ b/src/testcase/sections/configurationsections/rtIniSection.php @@ -15,7 +15,7 @@ */ class rtIniSection extends rtConfigurationSection { - private $commandLineArguments = array(); + protected $commandLineArguments = array(); public function init() { diff --git a/src/testcase/sections/configurationsections/rtPostRawSection.php b/src/testcase/sections/configurationsections/rtPostRawSection.php index 00faca2..e1283f2 100644 --- a/src/testcase/sections/configurationsections/rtPostRawSection.php +++ b/src/testcase/sections/configurationsections/rtPostRawSection.php @@ -14,8 +14,8 @@ */ class rtPostRawSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtPostSection.php b/src/testcase/sections/configurationsections/rtPostSection.php index 6766860..3e7d0c2 100644 --- a/src/testcase/sections/configurationsections/rtPostSection.php +++ b/src/testcase/sections/configurationsections/rtPostSection.php @@ -14,8 +14,8 @@ */ class rtPostSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtStdinSection.php b/src/testcase/sections/configurationsections/rtStdinSection.php index 4e01e85..277f15a 100644 --- a/src/testcase/sections/configurationsections/rtStdinSection.php +++ b/src/testcase/sections/configurationsections/rtStdinSection.php @@ -15,7 +15,7 @@ */ class rtStdinSection extends rtConfigurationSection { - private $inputString; + protected $inputString; protected function init() { diff --git a/src/testcase/sections/executablesections/rtFileExternalSection.php b/src/testcase/sections/executablesections/rtFileExternalSection.php index ade941a..4b141bd 100644 --- a/src/testcase/sections/executablesections/rtFileExternalSection.php +++ b/src/testcase/sections/executablesections/rtFileExternalSection.php @@ -31,7 +31,7 @@ class rtFileExternalSection extends rtFileSection /** * @return boolean */ - private function copyExternalFileContent($testStatus) + protected function copyExternalFileContent($testStatus) { if (sizeof($this->sectionContents) != 1) { $testStatus->setTrue('fail'); diff --git a/src/testcase/sections/executablesections/rtFileSection.php b/src/testcase/sections/executablesections/rtFileSection.php index 295f371..58ac759 100644 --- a/src/testcase/sections/executablesections/rtFileSection.php +++ b/src/testcase/sections/executablesections/rtFileSection.php @@ -14,9 +14,9 @@ */ class rtFileSection extends rtExecutableSection { - private $twoBlankLines = '\r?\n\r?\n'; - private $headers; - private $memFileName; + protected $twoBlankLines = '\r?\n\r?\n'; + protected $headers; + protected $memFileName; public function setExecutableFileName($testName) { diff --git a/src/testcase/sections/outputsections/rtExpectFSection.php b/src/testcase/sections/outputsections/rtExpectFSection.php index d44f757..0190526 100644 --- a/src/testcase/sections/outputsections/rtExpectFSection.php +++ b/src/testcase/sections/outputsections/rtExpectFSection.php @@ -37,7 +37,7 @@ class rtExpectFSection extends rtOutputSection * @param string * @return string */ - private function expectfUnicodeSubstitutions($string) + protected function expectfUnicodeSubstitutions($string) { $string = str_replace( array('%unicode_string_optional%'), @@ -72,7 +72,7 @@ class rtExpectFSection extends rtOutputSection * @param string * @return string */ - private function expectfRegexSubstitutions($string) + protected function expectfRegexSubstitutions($string) { $string = str_replace('%e', '\\' . DIRECTORY_SEPARATOR, $string); $string = str_replace('%s', '[^\r\n]+', $string); @@ -94,7 +94,7 @@ class rtExpectFSection extends rtOutputSection * @param string * @return string */ - private function expectfEmbeddedRegex($string) { + protected function expectfEmbeddedRegex($string) { $temp = ""; $r = "%r"; $startOffset = 0; diff --git a/src/testcase/sections/rtSection.php b/src/testcase/sections/rtSection.php index 9537930..79579bc 100644 --- a/src/testcase/sections/rtSection.php +++ b/src/testcase/sections/rtSection.php @@ -15,7 +15,7 @@ */ abstract class rtSection { - private static $sectionMap = array ( + protected static $sectionMap = array ( 'TEST' => 'rtTestHeaderSection', 'DESCRIPTION' => 'rtDescriptionSection', 'SKIPIF' => 'rtSkipIfSection', diff --git a/src/testgroup/rtPhpTestGroup.php b/src/testgroup/rtPhpTestGroup.php index 200f4f9..62d6cd3 100644 --- a/src/testgroup/rtPhpTestGroup.php +++ b/src/testgroup/rtPhpTestGroup.php @@ -14,9 +14,9 @@ */ class rtPhpTestGroup { - private $testDirectory; - private $testCases; - private $results; + protected $testDirectory; + protected $testCases; + protected $results; public function __construct(rtRuntestsConfiguration $runConfiguration, $directory) { diff --git a/src/testrun/rtPhpTestRun.php b/src/testrun/rtPhpTestRun.php index 20c9aa7..ca2616e 100644 --- a/src/testrun/rtPhpTestRun.php +++ b/src/testrun/rtPhpTestRun.php @@ -15,7 +15,7 @@ */ class rtPhpTestRun { - private $commandLineArguments; + protected $commandLineArguments; public function __construct($argv) {
diff --git a/src/configuration/preconditions/rtIsPhpVersionCorrect.php b/src/configuration/preconditions/rtIsPhpVersionCorrect.php index c730b67..3f635e5 100644 --- a/src/configuration/preconditions/rtIsPhpVersionCorrect.php +++ b/src/configuration/preconditions/rtIsPhpVersionCorrect.php @@ -19,12 +19,12 @@ class rtIsPhpVersionCorrect extends rtPreCondition /** * @var int */ - private $requiredMajorVersion = 5; + protected $requiredMajorVersion = 5; /** * @var int */ - private $requiredMinorVersion = 3; + protected $requiredMinorVersion = 3; /** * Return the message associated with an invalid php-version diff --git a/src/configuration/rtEnvironmentVariables.php b/src/configuration/rtEnvironmentVariables.php index deafa0b..8069211 100644 --- a/src/configuration/rtEnvironmentVariables.php +++ b/src/configuration/rtEnvironmentVariables.php @@ -31,7 +31,7 @@ class rtEnvironmentVariables 'NO_PHPTEST_SUMMARY', ); - private $environmentVariables = array(); + protected $environmentVariables = array(); public function __construct() { diff --git a/src/configuration/rtRuntestsConfiguration.php b/src/configuration/rtRuntestsConfiguration.php index 62b7e9c..7d531bd 100644 --- a/src/configuration/rtRuntestsConfiguration.php +++ b/src/configuration/rtRuntestsConfiguration.php @@ -19,13 +19,13 @@ abstract class rtRuntestsConfiguration { protected $commandLineArgs; - private $settings; - private $environmentVariables; - private $commandLine; + protected $settings; + protected $environmentVariables; + protected $commandLine; - private $memoryTool = null; + protected $memoryTool = null; - private $settingNames = array ( + protected $settingNames = array ( 'CurrentDirectory' => 'rtCurrentDirectorySetting', 'WorkingDirectory' => 'rtWorkingDirectorySetting', diff --git a/src/configuration/settings/rtCurrentDirectorySetting.php b/src/configuration/settings/rtCurrentDirectorySetting.php index b041a9d..cba3d46 100644 --- a/src/configuration/settings/rtCurrentDirectorySetting.php +++ b/src/configuration/settings/rtCurrentDirectorySetting.php @@ -15,7 +15,7 @@ */ class rtCurrentDirectorySetting extends rtSetting { - private $currentDirectory; + protected $currentDirectory; /** * Set the current directory diff --git a/src/configuration/settings/rtLogFormatSetting.php b/src/configuration/settings/rtLogFormatSetting.php index 29cfe25..9fdd821 100644 --- a/src/configuration/settings/rtLogFormatSetting.php +++ b/src/configuration/settings/rtLogFormatSetting.php @@ -19,7 +19,7 @@ */ class rtLogFormatSetting extends rtSetting { - private $logFormat; + protected $logFormat; /** * Sets log format to that specifiled by TEST_PHP_LOG_FORMAT or LEOD diff --git a/src/configuration/settings/rtPhpCgiExecutableSetting.php b/src/configuration/settings/rtPhpCgiExecutableSetting.php index 2d1c141..db81b0d 100644 --- a/src/configuration/settings/rtPhpCgiExecutableSetting.php +++ b/src/configuration/settings/rtPhpCgiExecutableSetting.php @@ -17,9 +17,9 @@ class rtPhpCgiExecutableSetting extends rtSetting { const SAPI_CGI = "/sapi/cgi/php-cgi"; - private $phpCgiExecutable; + protected $phpCgiExecutable; - private $configuration; + protected $configuration; /** * Sets the PHP CGI executable. Note the dependency on having a working directory setting diff --git a/src/configuration/settings/rtPhpCommandLineArgSetting.php b/src/configuration/settings/rtPhpCommandLineArgSetting.php index b18fa99..dc1cf1c 100644 --- a/src/configuration/settings/rtPhpCommandLineArgSetting.php +++ b/src/configuration/settings/rtPhpCommandLineArgSetting.php @@ -16,7 +16,7 @@ */ class rtPhpCommandLineArgSetting extends rtSetting { - private $phpCommandLineArguments; + protected $phpCommandLineArguments; /** * Sets the command line arguments for diff --git a/src/configuration/settings/rtPhpExecutableSetting.php b/src/configuration/settings/rtPhpExecutableSetting.php index bc2a36b..99dd693 100644 --- a/src/configuration/settings/rtPhpExecutableSetting.php +++ b/src/configuration/settings/rtPhpExecutableSetting.php @@ -17,7 +17,7 @@ class rtPhpExecutableSetting extends rtSetting { const SAPI_CLI = "/sapi/cli/php"; - private $phpExecutable; + protected $phpExecutable; /** * Sets the PHP executable, note the dependency on working directory diff --git a/src/configuration/settings/rtTestDirectorySetting.php b/src/configuration/settings/rtTestDirectorySetting.php index fde918c..f2cce9f 100644 --- a/src/configuration/settings/rtTestDirectorySetting.php +++ b/src/configuration/settings/rtTestDirectorySetting.php @@ -17,7 +17,7 @@ */ class rtTestDirectorySetting extends rtSetting { - private $testDir = null; + protected $testDir = null; /** * Check each option - if it's a directory add it to the list. diff --git a/src/configuration/settings/rtTestFileSetting.php b/src/configuration/settings/rtTestFileSetting.php index 69104ec..d6e747f 100644 --- a/src/configuration/settings/rtTestFileSetting.php +++ b/src/configuration/settings/rtTestFileSetting.php @@ -17,7 +17,7 @@ */ class rtTestFileSetting extends rtSetting { - private $testFiles; + protected $testFiles; /** * Check each filename - if it's not a directory and the name ends .phpt diff --git a/src/configuration/settings/rtWorkingDirectorySetting.php b/src/configuration/settings/rtWorkingDirectorySetting.php index 9c36178..b715245 100644 --- a/src/configuration/settings/rtWorkingDirectorySetting.php +++ b/src/configuration/settings/rtWorkingDirectorySetting.php @@ -16,7 +16,7 @@ */ class rtWorkingDirectorySetting extends rtSetting { - private $workingDirectory; + protected $workingDirectory; /** * Sets the working directory diff --git a/src/taskScheduler/rtTaskSchedulerFile.php b/src/taskScheduler/rtTaskSchedulerFile.php index 993e95f..7f98828 100644 --- a/src/taskScheduler/rtTaskSchedulerFile.php +++ b/src/taskScheduler/rtTaskSchedulerFile.php @@ -17,8 +17,8 @@ class rtTaskSchedulerFile extends rtTaskScheduler { const TMP_FILE = 'taskFile'; - private $pidStore = array(); // stores the pids of all child-processes - private $groupTasks = false; // are the tasks stored in groups? + protected $pidStore = array(); // stores the pids of all child-processes + protected $groupTasks = false; // are the tasks stored in groups? /** @@ -140,7 +140,7 @@ class rtTaskSchedulerFile extends rtTaskScheduler * creates a temporary file for each child which stores serialized task-objects * */ - private function distributeTasks() { + protected function distributeTasks() { if ($this->groupTasks == true) { @@ -170,7 +170,7 @@ class rtTaskSchedulerFile extends rtTaskScheduler * * @return void */ - private function receiver() + protected function receiver() { for ($cid=0; $cid<$this->processCount; $cid++) { @@ -202,7 +202,7 @@ class rtTaskSchedulerFile extends rtTaskScheduler * @param int $cid the child-id * @return void */ - private function child($cid) + protected function child($cid) { $taskList = file_get_contents(self::TMP_FILE.$cid); $taskList = explode('[END]', $taskList); diff --git a/src/taskScheduler/rtTaskSchedulerMsgQ.php b/src/taskScheduler/rtTaskSchedulerMsgQ.php index 14dd2b4..5845dd0 100644 --- a/src/taskScheduler/rtTaskSchedulerMsgQ.php +++ b/src/taskScheduler/rtTaskSchedulerMsgQ.php @@ -21,9 +21,9 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler const MSG_QUEUE_SIZE = 1024; // max-size of a single message const KILL_CHILD = 'killBill'; // kill-signal to terminate a child - private $inputQueue = NULL; // the input-queue (only used by the sender) - private $pidStore = array(); // stores the pids of all child-processes - private $groupTasks = false; // are the tasks stored in groups? + protected $inputQueue = NULL; // the input-queue (only used by the sender) + protected $pidStore = array(); // stores the pids of all child-processes + protected $groupTasks = false; // are the tasks stored in groups? @@ -70,7 +70,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler /** * removes the used message-queues. */ - private static function cleanUp() + protected static function cleanUp() { @msg_remove_queue(msg_get_queue(self::MSG_QUEUE_KEY)); @msg_remove_queue(msg_get_queue(self::MSG_QUEUE_KEY+1)); @@ -174,7 +174,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * * @return void */ - private function receiver() + protected function receiver() { $resultQueue = msg_get_queue(self::MSG_QUEUE_KEY+1); @@ -241,7 +241,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * * @return void */ - private function sender() + protected function sender() { $this->inputQueue = msg_get_queue(self::MSG_QUEUE_KEY); @@ -273,7 +273,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * @param int $type the message-type (default=1) * @return void */ - private function sendTask(task $task, $index, $type=1) + protected function sendTask(task $task, $index, $type=1) { $task->setIndex($index); @@ -297,7 +297,7 @@ class rtTaskSchedulerMsgQ extends rtTaskScheduler * @param int $cid the child-id (default=NULL) * @return void */ - private function child($cid=NULL) + protected function child($cid=NULL) { if (is_null($cid)) { $cid = 0; diff --git a/src/taskScheduler/rtTaskTestGroup.php b/src/taskScheduler/rtTaskTestGroup.php index 89c5b9a..078a10c 100644 --- a/src/taskScheduler/rtTaskTestGroup.php +++ b/src/taskScheduler/rtTaskTestGroup.php @@ -13,8 +13,8 @@ */ class rtTaskTestGroup extends rtTask implements rtTaskInterface { - private $runConfiguration; - private $subDirectory; + protected $runConfiguration; + protected $subDirectory; public function __construct($runConfiguration, $subDirectory) diff --git a/src/testcase/output/rtTestOutputWriterHTML.php b/src/testcase/output/rtTestOutputWriterHTML.php index 8d0d51b..b4e6e3d 100644 --- a/src/testcase/output/rtTestOutputWriterHTML.php +++ b/src/testcase/output/rtTestOutputWriterHTML.php @@ -16,8 +16,8 @@ */ class rtTestOutputWriterHTML extends rtTestOutputWriter { - private $dom = null; - private $stage = null; // base-node which holds the content + protected $dom = null; + protected $stage = null; // base-node which holds the content public function __construct() diff --git a/src/testcase/output/rtTestOutputWriterXML.php b/src/testcase/output/rtTestOutputWriterXML.php index e284faf..daa54de 100644 --- a/src/testcase/output/rtTestOutputWriterXML.php +++ b/src/testcase/output/rtTestOutputWriterXML.php @@ -16,8 +16,8 @@ */ class rtTestOutputWriterXML extends rtTestOutputWriter { - private $dom = null; - private $rootNode = null; + protected $dom = null; + protected $rootNode = null; public function __construct() diff --git a/src/testcase/preconditions/rtHasNoEmptySections.php b/src/testcase/preconditions/rtHasNoEmptySections.php index ba7b76b..9206ded 100644 --- a/src/testcase/preconditions/rtHasNoEmptySections.php +++ b/src/testcase/preconditions/rtHasNoEmptySections.php @@ -15,7 +15,7 @@ */ class rtHasNoEmptySections implements rtTestPreCondition { - private function isSectionHeading($string) { + protected function isSectionHeading($string) { return preg_match("/^--[A-Z]+(_[A-Z]+|)--/", $string); } diff --git a/src/testcase/preconditions/rtIsSectionImplemented.php b/src/testcase/preconditions/rtIsSectionImplemented.php index f2621d6..278ddb7 100644 --- a/src/testcase/preconditions/rtIsSectionImplemented.php +++ b/src/testcase/preconditions/rtIsSectionImplemented.php @@ -15,7 +15,7 @@ */ class rtIsSectionImplemented implements rtTestPreCondition { - private $sectionMap = array( + protected $sectionMap = array( 'TEST' => 'rtTestHeaderSection', 'DESCRIPTION' => 'rtDescriptionSection', 'SKIPIF' => 'rtSkipIfSection', diff --git a/src/testcase/preconditions/rtIsValidSectionName.php b/src/testcase/preconditions/rtIsValidSectionName.php index d08e916..e8159cb 100644 --- a/src/testcase/preconditions/rtIsValidSectionName.php +++ b/src/testcase/preconditions/rtIsValidSectionName.php @@ -15,7 +15,7 @@ */ class rtIsValidSectionName implements rtTestPreCondition { - private $validSectionNames = array( + protected $validSectionNames = array( 'TEST', 'DESCRIPTION', 'SKIPIF', diff --git a/src/testcase/rtPhpRunner.php b/src/testcase/rtPhpRunner.php index 8ddb058..6b56c1f 100644 --- a/src/testcase/rtPhpRunner.php +++ b/src/testcase/rtPhpRunner.php @@ -15,11 +15,11 @@ */ class rtPhpRunner { - private $phpCommand; - private $environmentVariables; - private $currentWorkingDirectory; - private $stdin; - private $timeOut; + protected $phpCommand; + protected $environmentVariables; + protected $currentWorkingDirectory; + protected $stdin; + protected $timeOut; public function __construct($phpCommand, $environmentVariables=null, $currentWorkingDirectory=null, $stdin = null, $timeOut = 60) { diff --git a/src/testcase/rtPhpTest.php b/src/testcase/rtPhpTest.php index 0acb168..785bf3e 100644 --- a/src/testcase/rtPhpTest.php +++ b/src/testcase/rtPhpTest.php @@ -16,14 +16,14 @@ class rtPhpTest { public $testConfiguration; - private $testName; - private $contents; - private $testStatus; - private $output; - private $sections; - private $fileSection; - private $expectSection; - private $sectionHeadings; + protected $testName; + protected $contents; + protected $testStatus; + protected $output; + protected $sections; + protected $fileSection; + protected $expectSection; + protected $sectionHeadings; public function __construct(array $contents, $testName, $sectionHeadings, $runConfiguration, $testStatus) { @@ -164,7 +164,7 @@ class rtPhpTest * Identify a FILE section * */ - private function isFileSection($key) + protected function isFileSection($key) { if (strpos($key, "FILE") !== false) { return true; @@ -176,7 +176,7 @@ class rtPhpTest /* * Strip the lines after ===DONE=== from the file section of a test */ - private function removeDone($array) { + protected function removeDone($array) { $result = array(); foreach($array as $line) { $result[] = $line; @@ -192,7 +192,7 @@ class rtPhpTest /** * Set the test's file section */ - private function setFileSection() + protected function setFileSection() { if (array_key_exists('FILE', $this->sections)) { return $this->sections['FILE']; @@ -211,7 +211,7 @@ class rtPhpTest /** * Sets the test's expect section */ - private function setExpectSection() + protected function setExpectSection() { if (array_key_exists('EXPECT', $this->sections)) { return $this->sections['EXPECT']; diff --git a/src/testcase/rtPhpTestFile.php b/src/testcase/rtPhpTestFile.php index dfc9de7..07a0e93 100644 --- a/src/testcase/rtPhpTestFile.php +++ b/src/testcase/rtPhpTestFile.php @@ -14,16 +14,16 @@ */ class rtPhpTestFile { - private $fileName; - private $testName; - private $testContents; - private $testExitMessage; - private $sectionHeadings = array(); + protected $fileName; + protected $testName; + protected $testContents; + protected $testExitMessage; + protected $sectionHeadings = array(); - private $carriageReturn = "\r"; - private $newLine = "\n"; + protected $carriageReturn = "\r"; + protected $newLine = "\n"; - private $preConditions = array ( + protected $preConditions = array ( 'rtHasMandatorySections', 'rtHasNoDuplicateSections', 'rtIsValidSectionName', @@ -31,16 +31,16 @@ class rtPhpTestFile 'rtHasNoEmptySections', ); - private function isSectionHeading($string) { + protected function isSectionHeading($string) { return preg_match("/^\s*--[A-Z]+(_[A-Z]+|)--/", $string); } - private function getUntrimmedSectionHeading($string) { + protected function getUntrimmedSectionHeading($string) { preg_match("/^\s*(--[A-Z]+(_[A-Z]+|)--)/", $string, $matches); return $matches[1]; } - private function getSectionHeading($string) { + protected function getSectionHeading($string) { preg_match("/^\s*--([A-Z]+(_[A-Z]+|))--/", $string, $matches); return $matches[1]; } diff --git a/src/testcase/rtTestConfiguration.php b/src/testcase/rtTestConfiguration.php index dbd1f37..44abeb2 100644 --- a/src/testcase/rtTestConfiguration.php +++ b/src/testcase/rtTestConfiguration.php @@ -15,14 +15,14 @@ */ class rtTestConfiguration { - private $environmentVariables; - private $phpCommandLineArguments; - private $testCommandLineArguments; - private $phpExecutable; - private $inputFileString; - private $stdin = null; - private $cgiTest = false; - private $cgiSections = array( + protected $environmentVariables; + protected $phpCommandLineArguments; + protected $testCommandLineArguments; + protected $phpExecutable; + protected $inputFileString; + protected $stdin = null; + protected $cgiTest = false; + protected $cgiSections = array( 'GET', 'POST', 'POST_RAW', @@ -37,7 +37,7 @@ class rtTestConfiguration $this->init($runConfiguration, $sections, $sectionHeadings, $fileSection); } - private function init(rtRuntestsConfiguration $runConfiguration, $sections, $sectionHeadings, $fileSection) + protected function init(rtRuntestsConfiguration $runConfiguration, $sections, $sectionHeadings, $fileSection) { $this->setCgiTest($sectionHeadings); @@ -50,7 +50,7 @@ class rtTestConfiguration } - private function setEnvironmentVariables(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) + protected function setEnvironmentVariables(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) { $this->environmentVariables = $runConfiguration->getEnvironmentVariables(); @@ -88,7 +88,7 @@ class rtTestConfiguration } - private function setPhpCommandLineArguments(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) + protected function setPhpCommandLineArguments(rtRuntestsConfiguration $runConfiguration, $sections, $fileSection) { $this->phpCommandLineArguments = $runConfiguration->getSetting('PhpCommandLineArguments'); if (array_key_exists('INI', $sections)) { @@ -99,7 +99,7 @@ class rtTestConfiguration } } - private function setTestCommandLineArguments($sections) + protected function setTestCommandLineArguments($sections) { $this->testCommandLineArguments = ''; @@ -108,7 +108,7 @@ class rtTestConfiguration } } - private function setPhpExecutable($runConfiguration, $sectionHeadings) + protected function setPhpExecutable($runConfiguration, $sectionHeadings) { if ($this->cgiTest) { if($runConfiguration->getSetting('PhpCgiExecutable') != null) { @@ -121,7 +121,7 @@ class rtTestConfiguration } } - private function setInputFileString($runConfiguration, $sections, $sectionHeadings) + protected function setInputFileString($runConfiguration, $sections, $sectionHeadings) { $this->inputFileString = ''; if(in_array('POST', $sectionHeadings)) { @@ -138,7 +138,7 @@ class rtTestConfiguration } } - private function setCgiTest($sectionHeadings) + protected function setCgiTest($sectionHeadings) { $tempArray = array_diff($this->cgiSections, $sectionHeadings); if (count($tempArray) < count($this->cgiSections)) { @@ -146,7 +146,7 @@ class rtTestConfiguration } } - private function setStdin($sections, $sectionHeadings) { + protected function setStdin($sections, $sectionHeadings) { if(in_array('STDIN', $sectionHeadings)) { $this->stdin = $sections['STDIN']->getInputString(); } diff --git a/src/testcase/rtTestDifference.php b/src/testcase/rtTestDifference.php index 1471dec..f1ebcd4 100644 --- a/src/testcase/rtTestDifference.php +++ b/src/testcase/rtTestDifference.php @@ -15,10 +15,10 @@ */ class rtTestDifference { - private $difference; - private $expectedOutput; - private $output; - private $expectedRegularExpression; + protected $difference; + protected $expectedOutput; + protected $output; + protected $expectedRegularExpression; public function __construct(rtOutputSection $expectedOutput, $output) { diff --git a/src/testcase/rtTestResults.php b/src/testcase/rtTestResults.php index ca6fe3d..3f7e6c8 100644 --- a/src/testcase/rtTestResults.php +++ b/src/testcase/rtTestResults.php @@ -19,11 +19,11 @@ */ class rtTestResults { - private $testStatus; - private $testName = ''; - private $savedFileNames = array(); - private $title = ''; - private $time = 0; + protected $testStatus; + protected $testName = ''; + protected $savedFileNames = array(); + protected $title = ''; + protected $time = 0; public function __construct(rtPhpTest $testCase = null, rtTestStatus $testStatus = null) { @@ -76,7 +76,7 @@ class rtTestResults /** * Actions if a test passes */ - private function onPass(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) + protected function onPass(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { if (!$runConfiguration->hasCommandLineOption('keep-all') && !$runConfiguration->hasCommandLineOption('keep-php')) { $testCase->getFileSection()->deleteFile(); @@ -115,7 +115,7 @@ class rtTestResults } - private function onFail(rtPhpTest $testCase) + protected function onFail(rtPhpTest $testCase) { $testDifference = new rtTestDifference($testCase->getExpectSection(), $testCase->getOutput()); $difference = implode(b"\n",$testDifference->getDifference()); @@ -148,7 +148,7 @@ class rtTestResults } } - private function onSkip(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) + protected function onSkip(rtPhpTest $testCase, rtRuntestsConfiguration $runConfiguration) { if ($runConfiguration->hasCommandLineOption('keep-all') || $runConfiguration->hasCommandLineOption('keep-skip')) { $this->savedFileNames['skipif'] = $this->testName. 'skipif.php'; diff --git a/src/testcase/rtTestStatus.php b/src/testcase/rtTestStatus.php index 997beec..793ba75 100644 --- a/src/testcase/rtTestStatus.php +++ b/src/testcase/rtTestStatus.php @@ -14,10 +14,10 @@ */ class rtTestStatus { - private $testName; - private $states = array(); - private $messages = array(); - private $testStateNames = array ('skip', + protected $testName; + protected $states = array(); + protected $messages = array(); + protected $testStateNames = array ('skip', 'bork', 'warn', 'xfail', @@ -35,7 +35,7 @@ class rtTestStatus { $this->init(); } - private function init() + protected function init() { foreach ($this->testStateNames as $name) { $this->states[$name] = false; diff --git a/src/testcase/sections/configurationsections/rtArgsSection.php b/src/testcase/sections/configurationsections/rtArgsSection.php index 584be57..bfee825 100644 --- a/src/testcase/sections/configurationsections/rtArgsSection.php +++ b/src/testcase/sections/configurationsections/rtArgsSection.php @@ -15,7 +15,7 @@ */ class rtArgsSection extends rtConfigurationSection { - private $testCommandLineArguments; + protected $testCommandLineArguments; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtCookieSection.php b/src/testcase/sections/configurationsections/rtCookieSection.php index 0c57725..3501fba 100644 --- a/src/testcase/sections/configurationsections/rtCookieSection.php +++ b/src/testcase/sections/configurationsections/rtCookieSection.php @@ -14,7 +14,7 @@ */ class rtCookieSection extends rtConfigurationSection { - private $cookieVariables = array(); + protected $cookieVariables = array(); protected function init() { diff --git a/src/testcase/sections/configurationsections/rtDeflatePostSection.php b/src/testcase/sections/configurationsections/rtDeflatePostSection.php index c944fb2..c314f76 100644 --- a/src/testcase/sections/configurationsections/rtDeflatePostSection.php +++ b/src/testcase/sections/configurationsections/rtDeflatePostSection.php @@ -14,8 +14,8 @@ */ class rtDeflatePostSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtEnvSection.php b/src/testcase/sections/configurationsections/rtEnvSection.php index 8b6430c..f55f314 100644 --- a/src/testcase/sections/configurationsections/rtEnvSection.php +++ b/src/testcase/sections/configurationsections/rtEnvSection.php @@ -15,7 +15,7 @@ */ class rtEnvSection extends rtConfigurationSection { - private $testEnvironmentVariables = array(); + protected $testEnvironmentVariables = array(); protected function init() { diff --git a/src/testcase/sections/configurationsections/rtGetSection.php b/src/testcase/sections/configurationsections/rtGetSection.php index 420ac5a..91c4c7b 100644 --- a/src/testcase/sections/configurationsections/rtGetSection.php +++ b/src/testcase/sections/configurationsections/rtGetSection.php @@ -14,7 +14,7 @@ */ class rtGetSection extends rtConfigurationSection { - private $getVariables = array(); + protected $getVariables = array(); protected function init() { diff --git a/src/testcase/sections/configurationsections/rtGzipPostSection.php b/src/testcase/sections/configurationsections/rtGzipPostSection.php index bbe015d..778691a 100644 --- a/src/testcase/sections/configurationsections/rtGzipPostSection.php +++ b/src/testcase/sections/configurationsections/rtGzipPostSection.php @@ -14,8 +14,8 @@ */ class rtGzipPostSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtIniSection.php b/src/testcase/sections/configurationsections/rtIniSection.php index 549b5fe..82a7adc 100644 --- a/src/testcase/sections/configurationsections/rtIniSection.php +++ b/src/testcase/sections/configurationsections/rtIniSection.php @@ -15,7 +15,7 @@ */ class rtIniSection extends rtConfigurationSection { - private $commandLineArguments = array(); + protected $commandLineArguments = array(); public function init() { diff --git a/src/testcase/sections/configurationsections/rtPostRawSection.php b/src/testcase/sections/configurationsections/rtPostRawSection.php index 00faca2..e1283f2 100644 --- a/src/testcase/sections/configurationsections/rtPostRawSection.php +++ b/src/testcase/sections/configurationsections/rtPostRawSection.php @@ -14,8 +14,8 @@ */ class rtPostRawSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtPostSection.php b/src/testcase/sections/configurationsections/rtPostSection.php index 6766860..3e7d0c2 100644 --- a/src/testcase/sections/configurationsections/rtPostSection.php +++ b/src/testcase/sections/configurationsections/rtPostSection.php @@ -14,8 +14,8 @@ */ class rtPostSection extends rtConfigurationSection { - private $postVariables = array(); - private $postFileName; + protected $postVariables = array(); + protected $postFileName; protected function init() { diff --git a/src/testcase/sections/configurationsections/rtStdinSection.php b/src/testcase/sections/configurationsections/rtStdinSection.php index 4e01e85..277f15a 100644 --- a/src/testcase/sections/configurationsections/rtStdinSection.php +++ b/src/testcase/sections/configurationsections/rtStdinSection.php @@ -15,7 +15,7 @@ */ class rtStdinSection extends rtConfigurationSection { - private $inputString; + protected $inputString; protected function init() { diff --git a/src/testcase/sections/executablesections/rtFileExternalSection.php b/src/testcase/sections/executablesections/rtFileExternalSection.php index ade941a..4b141bd 100644 --- a/src/testcase/sections/executablesections/rtFileExternalSection.php +++ b/src/testcase/sections/executablesections/rtFileExternalSection.php @@ -31,7 +31,7 @@ class rtFileExternalSection extends rtFileSection /** * @return boolean */ - private function copyExternalFileContent($testStatus) + protected function copyExternalFileContent($testStatus) { if (sizeof($this->sectionContents) != 1) { $testStatus->setTrue('fail'); diff --git a/src/testcase/sections/executablesections/rtFileSection.php b/src/testcase/sections/executablesections/rtFileSection.php index 295f371..58ac759 100644 --- a/src/testcase/sections/executablesections/rtFileSection.php +++ b/src/testcase/sections/executablesections/rtFileSection.php @@ -14,9 +14,9 @@ */ class rtFileSection extends rtExecutableSection { - private $twoBlankLines = '\r?\n\r?\n'; - private $headers; - private $memFileName; + protected $twoBlankLines = '\r?\n\r?\n'; + protected $headers; + protected $memFileName; public function setExecutableFileName($testName) { diff --git a/src/testcase/sections/outputsections/rtExpectFSection.php b/src/testcase/sections/outputsections/rtExpectFSection.php index d44f757..0190526 100644 --- a/src/testcase/sections/outputsections/rtExpectFSection.php +++ b/src/testcase/sections/outputsections/rtExpectFSection.php @@ -37,7 +37,7 @@ class rtExpectFSection extends rtOutputSection * @param string * @return string */ - private function expectfUnicodeSubstitutions($string) + protected function expectfUnicodeSubstitutions($string) { $string = str_replace( array('%unicode_string_optional%'), @@ -72,7 +72,7 @@ class rtExpectFSection extends rtOutputSection * @param string * @return string */ - private function expectfRegexSubstitutions($string) + protected function expectfRegexSubstitutions($string) { $string = str_replace('%e', '\\' . DIRECTORY_SEPARATOR, $string); $string = str_replace('%s', '[^\r\n]+', $string); @@ -94,7 +94,7 @@ class rtExpectFSection extends rtOutputSection * @param string * @return string */ - private function expectfEmbeddedRegex($string) { + protected function expectfEmbeddedRegex($string) { $temp = ""; $r = "%r"; $startOffset = 0; diff --git a/src/testcase/sections/rtSection.php b/src/testcase/sections/rtSection.php index 9537930..79579bc 100644 --- a/src/testcase/sections/rtSection.php +++ b/src/testcase/sections/rtSection.php @@ -15,7 +15,7 @@ */ abstract class rtSection { - private static $sectionMap = array ( + protected static $sectionMap = array ( 'TEST' => 'rtTestHeaderSection', 'DESCRIPTION' => 'rtDescriptionSection', 'SKIPIF' => 'rtSkipIfSection', diff --git a/src/testgroup/rtPhpTestGroup.php b/src/testgroup/rtPhpTestGroup.php index 200f4f9..62d6cd3 100644 --- a/src/testgroup/rtPhpTestGroup.php +++ b/src/testgroup/rtPhpTestGroup.php @@ -14,9 +14,9 @@ */ class rtPhpTestGroup { - private $testDirectory; - private $testCases; - private $results; + protected $testDirectory; + protected $testCases; + protected $results; public function __construct(rtRuntestsConfiguration $runConfiguration, $directory) { diff --git a/src/testrun/rtPhpTestRun.php b/src/testrun/rtPhpTestRun.php index 20c9aa7..ca2616e 100644 --- a/src/testrun/rtPhpTestRun.php +++ b/src/testrun/rtPhpTestRun.php @@ -15,7 +15,7 @@ */ class rtPhpTestRun { - private $commandLineArguments; + protected $commandLineArguments; public function __construct($argv) {