This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Yet another batch of underscores removed from protected & private pro…

…perties
  • Loading branch information...
perrick committed Apr 26, 2008
1 parent 75e04ac commit 8941448059a9e2aa9a5b6c5b82c024923366cc13
Showing with 498 additions and 498 deletions.
  1. +149 −149 page.php
  2. +90 −90 parser.php
  3. +22 −22 reflection_php5.php
  4. +16 −16 remote.php
  5. +17 −17 reporter.php
  6. +18 −18 scorer.php
  7. +14 −14 selector.php
  8. +19 −19 shell_tester.php
  9. +14 −14 simpletest.php
  10. +31 −31 socket.php
  11. +54 −54 tag.php
  12. +54 −54 test_case.php
View
298 page.php

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -12,15 +12,15 @@
* @subpackage UnitTester
*/
class SimpleReflection {
- private $_interface;
+ private $interface;
/**
* Stashes the class/interface.
* @param string $interface Class or interface
* to inspect.
*/
function __construct($interface) {
- $this->_interface = $interface;
+ $this->interface = $interface;
}
/**
@@ -31,10 +31,10 @@ function __construct($interface) {
* @access public
*/
function classExists() {
- if (! class_exists($this->_interface)) {
+ if (! class_exists($this->interface)) {
return false;
}
- $reflection = new ReflectionClass($this->_interface);
+ $reflection = new ReflectionClass($this->interface);
return ! $reflection->isInterface();
}
@@ -45,7 +45,7 @@ function classExists() {
* @access public
*/
function classExistsSansAutoload() {
- return class_exists($this->_interface, false);
+ return class_exists($this->interface, false);
}
/**
@@ -55,7 +55,7 @@ function classExistsSansAutoload() {
* @access public
*/
function classOrInterfaceExists() {
- return $this->classOrInterfaceExistsWithAutoload($this->_interface, true);
+ return $this->classOrInterfaceExistsWithAutoload($this->interface, true);
}
/**
@@ -65,7 +65,7 @@ function classOrInterfaceExists() {
* @access public
*/
function classOrInterfaceExistsSansAutoload() {
- return $this->classOrInterfaceExistsWithAutoload($this->_interface, false);
+ return $this->classOrInterfaceExistsWithAutoload($this->interface, false);
}
/**
@@ -78,11 +78,11 @@ function classOrInterfaceExistsSansAutoload() {
*/
protected function classOrInterfaceExistsWithAutoload($interface, $autoload) {
if (function_exists('interface_exists')) {
- if (interface_exists($this->_interface, $autoload)) {
+ if (interface_exists($this->interface, $autoload)) {
return true;
}
}
- return class_exists($this->_interface, $autoload);
+ return class_exists($this->interface, $autoload);
}
/**
@@ -92,7 +92,7 @@ protected function classOrInterfaceExistsWithAutoload($interface, $autoload) {
* @access public
*/
function getMethods() {
- return array_unique(get_class_methods($this->_interface));
+ return array_unique(get_class_methods($this->interface));
}
/**
@@ -103,9 +103,9 @@ function getMethods() {
* @access public
*/
function getInterfaces() {
- $reflection = new ReflectionClass($this->_interface);
+ $reflection = new ReflectionClass($this->interface);
if ($reflection->isInterface()) {
- return array($this->_interface);
+ return array($this->interface);
}
return $this->onlyParents($reflection->getInterfaces());
}
@@ -141,7 +141,7 @@ protected function isInterfaceMethod($method) {
* @access public
*/
function getParent() {
- $reflection = new ReflectionClass($this->_interface);
+ $reflection = new ReflectionClass($this->interface);
$parent = $reflection->getParentClass();
if ($parent) {
return $parent->getName();
@@ -155,7 +155,7 @@ function getParent() {
* @access public
*/
function isAbstract() {
- $reflection = new ReflectionClass($this->_interface);
+ $reflection = new ReflectionClass($this->interface);
return $reflection->isAbstract();
}
@@ -165,7 +165,7 @@ function isAbstract() {
* @access public
*/
function isInterface() {
- $reflection = new ReflectionClass($this->_interface);
+ $reflection = new ReflectionClass($this->interface);
return $reflection->isInterface();
}
@@ -176,7 +176,7 @@ function isInterface() {
* @access public
*/
function hasFinal() {
- $reflection = new ReflectionClass($this->_interface);
+ $reflection = new ReflectionClass($this->interface);
foreach ($reflection->getMethods() as $method) {
if ($method->isFinal()) {
return true;
@@ -219,7 +219,7 @@ protected function onlyParents($interfaces) {
* @access private
*/
protected function isAbstractMethod($name) {
- $interface = new ReflectionClass($this->_interface);
+ $interface = new ReflectionClass($this->interface);
if (! $interface->hasMethod($name)) {
return false;
}
@@ -233,7 +233,7 @@ protected function isAbstractMethod($name) {
* @access private
*/
protected function isConstructor($name) {
- return ($name == '__construct') || ($name == $this->_interface);
+ return ($name == '__construct') || ($name == $this->interface);
}
/**
@@ -243,7 +243,7 @@ protected function isConstructor($name) {
* @access private
*/
protected function isAbstractMethodInParents($name) {
- $interface = new ReflectionClass($this->_interface);
+ $interface = new ReflectionClass($this->interface);
$parent = $interface->getParentClass();
while($parent) {
if (! $parent->hasMethod($name)) {
@@ -264,7 +264,7 @@ protected function isAbstractMethodInParents($name) {
* @access private
*/
protected function isStaticMethod($name) {
- $interface = new ReflectionClass($this->_interface);
+ $interface = new ReflectionClass($this->interface);
if (! $interface->hasMethod($name)) {
return false;
}
@@ -301,7 +301,7 @@ function getSignature($name) {
// doesn't exist prior to PHP 5.1.0, so we need to use a more crude
// detection method.
try {
- $interface = new ReflectionClass($this->_interface);
+ $interface = new ReflectionClass($this->interface);
$interface->getMethod($name);
} catch (ReflectionException $e) {
return "function $name()";
@@ -318,7 +318,7 @@ function getSignature($name) {
* @access private
*/
protected function getFullSignature($name) {
- $interface = new ReflectionClass($this->_interface);
+ $interface = new ReflectionClass($this->interface);
$method = $interface->getMethod($name);
$reference = $method->returnsReference() ? '&' : '';
$static = $method->isStatic() ? 'static ' : '';
View
@@ -20,9 +20,9 @@
* @subpackage UnitTester
*/
class RemoteTestCase {
- var $_url;
- var $_dry_url;
- var $_size;
+ private $url;
+ private $dry_url;
+ private $size;
/**
* Sets the location of the remote test.
@@ -31,9 +31,9 @@ class RemoteTestCase {
* @access public
*/
function __construct($url, $dry_url = false) {
- $this->_url = $url;
- $this->_dry_url = $dry_url ? $dry_url : $url;
- $this->_size = false;
+ $this->url = $url;
+ $this->dry_url = $dry_url ? $dry_url : $url;
+ $this->size = false;
}
/**
@@ -42,7 +42,7 @@ function __construct($url, $dry_url = false) {
* @access public
*/
function getLabel() {
- return $this->_url;
+ return $this->url;
}
/**
@@ -55,14 +55,14 @@ function getLabel() {
*/
function run($reporter) {
$browser = $this->createBrowser();
- $xml = $browser->get($this->_url);
+ $xml = $browser->get($this->url);
if (! $xml) {
- trigger_error('Cannot read remote test URL [' . $this->_url . ']');
+ trigger_error('Cannot read remote test URL [' . $this->url . ']');
return false;
}
$parser = $this->createParser($reporter);
if (! $parser->parse($xml)) {
- trigger_error('Cannot parse incoming XML from [' . $this->_url . ']');
+ trigger_error('Cannot parse incoming XML from [' . $this->url . ']');
return false;
}
return true;
@@ -94,22 +94,22 @@ protected function createParser($reporter) {
* @access public
*/
function getSize() {
- if ($this->_size === false) {
+ if ($this->size === false) {
$browser = $this->createBrowser();
- $xml = $browser->get($this->_dry_url);
+ $xml = $browser->get($this->dry_url);
if (! $xml) {
- trigger_error('Cannot read remote test URL [' . $this->_dry_url . ']');
+ trigger_error('Cannot read remote test URL [' . $this->dry_url . ']');
return false;
}
$reporter = new SimpleReporter();
$parser = $this->createParser($reporter);
if (! $parser->parse($xml)) {
- trigger_error('Cannot parse incoming XML from [' . $this->_dry_url . ']');
+ trigger_error('Cannot parse incoming XML from [' . $this->dry_url . ']');
return false;
}
- $this->_size = $reporter->getTestCaseCount();
+ $this->size = $reporter->getTestCaseCount();
}
- return $this->_size;
+ return $this->size;
}
}
?>
View
@@ -19,7 +19,7 @@
* @subpackage UnitTester
*/
class HtmlReporter extends SimpleReporter {
- private $_character_set;
+ private $character_set;
/**
* Does nothing yet. The first output will
@@ -29,7 +29,7 @@ class HtmlReporter extends SimpleReporter {
*/
function __construct($character_set = 'ISO-8859-1') {
parent::__construct();
- $this->_character_set = $character_set;
+ $this->character_set = $character_set;
}
/**
@@ -43,7 +43,7 @@ function paintHeader($test_name) {
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
print "<html>\n<head>\n<title>$test_name</title>\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" .
- $this->_character_set . "\">\n";
+ $this->character_set . "\">\n";
print "<style type=\"text/css\">\n";
print $this->getCss() . "\n";
print "</style>\n";
@@ -178,7 +178,7 @@ function paintFormattedMessage($message) {
* @access protected
*/
protected function htmlEntities($message) {
- return htmlentities($message, ENT_COMPAT, $this->_character_set);
+ return htmlentities($message, ENT_COMPAT, $this->character_set);
}
}
@@ -311,9 +311,9 @@ function paintFormattedMessage($message) {
* @subpackage UnitTester
*/
class SelectiveReporter extends SimpleReporterDecorator {
- private $_just_this_case = false;
- private $_just_this_test = false;
- private $_on;
+ private $just_this_case = false;
+ private $just_this_test = false;
+ private $on;
/**
* Selects the test case or group to be run,
@@ -324,13 +324,13 @@ class SelectiveReporter extends SimpleReporterDecorator {
*/
function __construct($reporter, $just_this_case = false, $just_this_test = false) {
if (isset($just_this_case) && $just_this_case) {
- $this->_just_this_case = strtolower($just_this_case);
+ $this->just_this_case = strtolower($just_this_case);
$this->off();
} else {
$this->on();
}
if (isset($just_this_test) && $just_this_test) {
- $this->_just_this_test = strtolower($just_this_test);
+ $this->just_this_test = strtolower($just_this_test);
}
parent::__construct($reporter);
}
@@ -342,7 +342,7 @@ function __construct($reporter, $just_this_case = false, $just_this_test = false
* @access protected
*/
protected function matchesTestCase($test_case) {
- return $this->_just_this_case == strtolower($test_case);
+ return $this->just_this_case == strtolower($test_case);
}
/**
@@ -355,8 +355,8 @@ protected function matchesTestCase($test_case) {
*/
protected function shouldRunTest($test_case, $method) {
if ($this->isOn() || $this->matchesTestCase($test_case)) {
- if ($this->_just_this_test) {
- return $this->_just_this_test == strtolower($method);
+ if ($this->just_this_test) {
+ return $this->just_this_test == strtolower($method);
} else {
return true;
}
@@ -369,15 +369,15 @@ protected function shouldRunTest($test_case, $method) {
* @access private
*/
protected function on() {
- $this->_on = true;
+ $this->on = true;
}
/**
* Switch off testing for the group or subgroup.
* @access private
*/
protected function off() {
- $this->_on = false;
+ $this->on = false;
}
/**
@@ -386,7 +386,7 @@ protected function off() {
* @access private
*/
protected function isOn() {
- return $this->_on;
+ return $this->on;
}
/**
@@ -410,7 +410,7 @@ function shouldInvoke($test_case, $method) {
* @access public
*/
function paintGroupStart($test_case, $size) {
- if ($this->_just_this_case && $this->matchesTestCase($test_case)) {
+ if ($this->just_this_case && $this->matchesTestCase($test_case)) {
$this->on();
}
$this->_reporter->paintGroupStart($test_case, $size);
@@ -423,7 +423,7 @@ function paintGroupStart($test_case, $size) {
*/
function paintGroupEnd($test_case) {
$this->_reporter->paintGroupEnd($test_case);
- if ($this->_just_this_case && $this->matchesTestCase($test_case)) {
+ if ($this->just_this_case && $this->matchesTestCase($test_case)) {
$this->off();
}
}
Oops, something went wrong.

0 comments on commit 8941448

Please sign in to comment.