Skip to content

Commit

Permalink
change to use protected rather than private
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe Slattery committed Aug 6, 2009
1 parent 9f971fe commit ec4c248
Show file tree
Hide file tree
Showing 42 changed files with 126 additions and 126 deletions.
4 changes: 2 additions & 2 deletions src/configuration/preconditions/rtIsPhpVersionCorrect.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/rtEnvironmentVariables.php
Expand Up @@ -31,7 +31,7 @@ class rtEnvironmentVariables
'NO_PHPTEST_SUMMARY',
);

private $environmentVariables = array();
protected $environmentVariables = array();

public function __construct()
{
Expand Down
10 changes: 5 additions & 5 deletions src/configuration/rtRuntestsConfiguration.php
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/settings/rtCurrentDirectorySetting.php
Expand Up @@ -15,7 +15,7 @@
*/
class rtCurrentDirectorySetting extends rtSetting
{
private $currentDirectory;
protected $currentDirectory;

/**
* Set the current directory
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/settings/rtLogFormatSetting.php
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/configuration/settings/rtPhpCgiExecutableSetting.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/settings/rtPhpCommandLineArgSetting.php
Expand Up @@ -16,7 +16,7 @@
*/
class rtPhpCommandLineArgSetting extends rtSetting
{
private $phpCommandLineArguments;
protected $phpCommandLineArguments;

/**
* Sets the command line arguments for
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/settings/rtPhpExecutableSetting.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/settings/rtTestDirectorySetting.php
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/settings/rtTestFileSetting.php
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/settings/rtWorkingDirectorySetting.php
Expand Up @@ -16,7 +16,7 @@
*/
class rtWorkingDirectorySetting extends rtSetting
{
private $workingDirectory;
protected $workingDirectory;

/**
* Sets the working directory
Expand Down
10 changes: 5 additions & 5 deletions src/taskScheduler/rtTaskSchedulerFile.php
Expand Up @@ -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?

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ public function run()
* creates a temporary file for each child which stores serialized task-objects
*
*/
private function distributeTasks() {
protected function distributeTasks() {

if ($this->groupTasks == true) {

Expand Down Expand Up @@ -170,7 +170,7 @@ private function distributeTasks() {
*
* @return void
*/
private function receiver()
protected function receiver()
{
for ($cid=0; $cid<$this->processCount; $cid++) {

Expand Down Expand Up @@ -202,7 +202,7 @@ private function receiver()
* @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);
Expand Down
16 changes: 8 additions & 8 deletions src/taskScheduler/rtTaskSchedulerMsgQ.php
Expand Up @@ -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?


Expand Down Expand Up @@ -70,7 +70,7 @@ public function setProcessCount($processCount)
/**
* 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));
Expand Down Expand Up @@ -174,7 +174,7 @@ public function run()
*
* @return void
*/
private function receiver()
protected function receiver()
{
$resultQueue = msg_get_queue(self::MSG_QUEUE_KEY+1);

Expand Down Expand Up @@ -241,7 +241,7 @@ private function receiver()
*
* @return void
*/
private function sender()
protected function sender()
{
$this->inputQueue = msg_get_queue(self::MSG_QUEUE_KEY);

Expand Down Expand Up @@ -273,7 +273,7 @@ private function sender()
* @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);

Expand All @@ -297,7 +297,7 @@ private function sendTask(task $task, $index, $type=1)
* @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;
Expand Down
4 changes: 2 additions & 2 deletions src/taskScheduler/rtTaskTestGroup.php
Expand Up @@ -13,8 +13,8 @@
*/
class rtTaskTestGroup extends rtTask implements rtTaskInterface
{
private $runConfiguration;
private $subDirectory;
protected $runConfiguration;
protected $subDirectory;


public function __construct($runConfiguration, $subDirectory)
Expand Down
4 changes: 2 additions & 2 deletions src/testcase/output/rtTestOutputWriterHTML.php
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/testcase/output/rtTestOutputWriterXML.php
Expand Up @@ -16,8 +16,8 @@
*/
class rtTestOutputWriterXML extends rtTestOutputWriter
{
private $dom = null;
private $rootNode = null;
protected $dom = null;
protected $rootNode = null;


public function __construct()
Expand Down
2 changes: 1 addition & 1 deletion src/testcase/preconditions/rtHasNoEmptySections.php
Expand Up @@ -15,7 +15,7 @@
*/
class rtHasNoEmptySections implements rtTestPreCondition
{
private function isSectionHeading($string) {
protected function isSectionHeading($string) {
return preg_match("/^--[A-Z]+(_[A-Z]+|)--/", $string);
}

Expand Down
2 changes: 1 addition & 1 deletion src/testcase/preconditions/rtIsSectionImplemented.php
Expand Up @@ -15,7 +15,7 @@
*/
class rtIsSectionImplemented implements rtTestPreCondition
{
private $sectionMap = array(
protected $sectionMap = array(
'TEST' => 'rtTestHeaderSection',
'DESCRIPTION' => 'rtDescriptionSection',
'SKIPIF' => 'rtSkipIfSection',
Expand Down
2 changes: 1 addition & 1 deletion src/testcase/preconditions/rtIsValidSectionName.php
Expand Up @@ -15,7 +15,7 @@
*/
class rtIsValidSectionName implements rtTestPreCondition
{
private $validSectionNames = array(
protected $validSectionNames = array(
'TEST',
'DESCRIPTION',
'SKIPIF',
Expand Down
10 changes: 5 additions & 5 deletions src/testcase/rtPhpRunner.php
Expand Up @@ -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)
{
Expand Down
24 changes: 12 additions & 12 deletions src/testcase/rtPhpTest.php
Expand Up @@ -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)
{
Expand Down Expand Up @@ -164,7 +164,7 @@ public function compareHeaders()
* Identify a FILE section
*
*/
private function isFileSection($key)
protected function isFileSection($key)
{
if (strpos($key, "FILE") !== false) {
return true;
Expand All @@ -176,7 +176,7 @@ private function isFileSection($key)
/*
* 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;
Expand All @@ -192,7 +192,7 @@ private function removeDone($array) {
/**
* Set the test's file section
*/
private function setFileSection()
protected function setFileSection()
{
if (array_key_exists('FILE', $this->sections)) {
return $this->sections['FILE'];
Expand All @@ -211,7 +211,7 @@ private function setFileSection()
/**
* Sets the test's expect section
*/
private function setExpectSection()
protected function setExpectSection()
{
if (array_key_exists('EXPECT', $this->sections)) {
return $this->sections['EXPECT'];
Expand Down
22 changes: 11 additions & 11 deletions src/testcase/rtPhpTestFile.php
Expand Up @@ -14,33 +14,33 @@
*/
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',
'rtIsSectionImplemented',
'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];
}
Expand Down

0 comments on commit ec4c248

Please sign in to comment.