Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Yet again, another batch of underscores removed from protected & priv…
Browse files Browse the repository at this point in the history
…ate properties
  • Loading branch information
perrick committed Apr 26, 2008
1 parent 8941448 commit 8e367e8
Show file tree
Hide file tree
Showing 11 changed files with 372 additions and 372 deletions.
90 changes: 45 additions & 45 deletions eclipse.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ class EclipseReporter extends SimpleScorer {
* @param boolean $cc Whether to include test coverage.
*/
function __construct(&$listener, $cc=false){
$this->_listener = &$listener;
$this->listener = &$listener;
$this->SimpleScorer();
$this->_case = "";
$this->_group = "";
$this->_method = "";
$this->_cc = $cc;
$this->_error = false;
$this->_fail = false;
$this->case = "";
$this->group = "";
$this->method = "";
$this->cc = $cc;
$this->error = false;
$this->fail = false;
}

/**
Expand Down Expand Up @@ -64,7 +64,7 @@ function &createListener($port, $host="127.0.0.1"){
* @access public
*/
function &createInvoker(&$invoker){
$eclinvoker = &new EclipseInvoker($invoker, $this->_listener);
$eclinvoker = &new EclipseInvoker($invoker, $this->listener);
return $eclinvoker;
}

Expand All @@ -86,10 +86,10 @@ function escapeVal($raw){
* @access public
*/
function paintPass($message){
if (! $this->_pass){
$this->_message = $this->escapeVal($message);
if (! $this->pass){
$this->message = $this->escapeVal($message);
}
$this->_pass = true;
$this->pass = true;
}

/**
Expand All @@ -100,10 +100,10 @@ function paintPass($message){
*/
function paintFail($message){
//only get the first failure or error
if (! $this->_fail && ! $this->_error){
$this->_fail = true;
$this->_message = $this->escapeVal($message);
$this->_listener->write('{status:"fail",message:"'.$this->_message.'",group:"'.$this->_group.'",case:"'.$this->_case.'",method:"'.$this->_method.'"}');
if (! $this->fail && ! $this->error){
$this->fail = true;
$this->message = $this->escapeVal($message);
$this->listener->write('{status:"fail",message:"'.$this->message.'",group:"'.$this->group.'",case:"'.$this->case.'",method:"'.$this->method.'"}');
}
}

Expand All @@ -114,10 +114,10 @@ function paintFail($message){
* @access public
*/
function paintError($message){
if (! $this->_fail && ! $this->_error){
$this->_error = true;
$this->_message = $this->escapeVal($message);
$this->_listener->write('{status:"error",message:"'.$this->_message.'",group:"'.$this->_group.'",case:"'.$this->_case.'",method:"'.$this->_method.'"}');
if (! $this->fail && ! $this->error){
$this->error = true;
$this->message = $this->escapeVal($message);
$this->listener->write('{status:"error",message:"'.$this->message.'",group:"'.$this->group.'",case:"'.$this->case.'",method:"'.$this->method.'"}');
}
}

Expand All @@ -129,15 +129,15 @@ function paintError($message){
* @access public
*/
function paintException($exception){
if (! $this->_fail && ! $this->_error){
$this->_error = true;
if (! $this->fail && ! $this->error){
$this->error = true;
$message = 'Unexpected exception of type[' . get_class($exception) .
'] with message [' . $exception->getMessage() . '] in [' .
$exception->getFile() .' line '. $exception->getLine() . ']';
$this->_message = $this->escapeVal($message);
$this->_listener->write(
'{status:"error",message:"' . $this->_message . '",group:"' .
$this->_group . '",case:"' . $this->_case . '",method:"' . $this->_method
$this->message = $this->escapeVal($message);
$this->listener->write(
'{status:"error",message:"' . $this->message . '",group:"' .
$this->group . '",case:"' . $this->case . '",method:"' . $this->method
. '"}');
}
}
Expand Down Expand Up @@ -167,10 +167,10 @@ function paintFooter($test_name) {
* @access public
*/
function paintMethodStart($method) {
$this->_pass = false;
$this->_fail = false;
$this->_error = false;
$this->_method = $this->escapeVal($method);
$this->pass = false;
$this->fail = false;
$this->error = false;
$this->method = $this->escapeVal($method);
}

/**
Expand All @@ -180,12 +180,12 @@ function paintMethodStart($method) {
* @access public
*/
function paintMethodEnd($method){
if ($this->_fail || $this->_error || ! $this->_pass){
if ($this->fail || $this->error || ! $this->pass){
} else {
$this->_listener->write(
'{status:"pass",message:"' . $this->_message . '",group:"' .
$this->_group . '",case:"' . $this->_case . '",method:"' .
$this->_method . '"}');
$this->listener->write(
'{status:"pass",message:"' . $this->message . '",group:"' .
$this->group . '",case:"' . $this->case . '",method:"' .
$this->method . '"}');
}
}

Expand All @@ -195,7 +195,7 @@ function paintMethodEnd($method){
* @access public
*/
function paintCaseStart($case){
$this->_case = $this->escapeVal($case);
$this->case = $this->escapeVal($case);
}

/**
Expand All @@ -204,7 +204,7 @@ function paintCaseStart($case){
* @access public
*/
function paintCaseEnd($case){
$this->_case = "";
$this->case = "";
}

/**
Expand All @@ -215,8 +215,8 @@ function paintCaseEnd($case){
* @access public
*/
function paintGroupStart($group, $size){
$this->_group = $this->escapeVal($group);
if ($this->_cc){
$this->group = $this->escapeVal($group);
if ($this->cc){
if (extension_loaded('xdebug')){
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
}
Expand All @@ -229,9 +229,9 @@ function paintGroupStart($group, $size){
* @access public
*/
function paintGroupEnd($group){
$this->_group = "";
$this->group = "";
$cc = "";
if ($this->_cc){
if ($this->cc){
if (extension_loaded('xdebug')){
$arrfiles = xdebug_get_code_coverage();
xdebug_stop_code_coverage();
Expand Down Expand Up @@ -261,7 +261,7 @@ function paintGroupEnd($group){
}
}
}
$this->_listener->write('{status:"coverage",message:"' .
$this->listener->write('{status:"coverage",message:"' .
EclipseReporter::escapeVal($cc) . '"}');
}
}
Expand All @@ -274,7 +274,7 @@ function paintGroupEnd($group){
*/
class EclipseInvoker extends SimpleInvokerDecorator{
function __construct(&$invoker, &$listener) {
$this->_listener = &$listener;
$this->listener = &$listener;
$this->SimpleInvokerDecorator($invoker);
}

Expand All @@ -285,7 +285,7 @@ function __construct(&$invoker, &$listener) {
*/
function before($method){
ob_start();
$this->_invoker->before($method);
$this->invoker->before($method);
}

/**
Expand All @@ -295,11 +295,11 @@ function before($method){
* @access public
*/
function after($method) {
$this->_invoker->after($method);
$this->invoker->after($method);
$output = ob_get_contents();
ob_end_clean();
if ($output !== ""){
$result = $this->_listener->write('{status:"info",message:"' .
$result = $this->listener->write('{status:"info",message:"' .
EclipseReporter::escapeVal($output) . '"}');
}
}
Expand Down
22 changes: 11 additions & 11 deletions expectation.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function testMessage($compare) {
* @subpackage UnitTester
*/
class EqualExpectation extends SimpleExpectation {
private $_value;
private $value;

/**
* Sets the value to compare against.
Expand All @@ -231,7 +231,7 @@ class EqualExpectation extends SimpleExpectation {
*/
function __construct($value, $message = '%s') {
parent::__construct($message);
$this->_value = $value;
$this->value = $value;
}

/**
Expand All @@ -242,7 +242,7 @@ function __construct($value, $message = '%s') {
* @access public
*/
function test($compare) {
return (($this->_value == $compare) && ($compare == $this->_value));
return (($this->value == $compare) && ($compare == $this->value));
}

/**
Expand All @@ -254,10 +254,10 @@ function test($compare) {
*/
function testMessage($compare) {
if ($this->test($compare)) {
return "Equal expectation [" . $this->dumper->describeValue($this->_value) . "]";
return "Equal expectation [" . $this->dumper->describeValue($this->value) . "]";
} else {
return "Equal expectation fails " .
$this->dumper->describeDifference($this->_value, $compare);
$this->dumper->describeDifference($this->value, $compare);
}
}

Expand All @@ -267,7 +267,7 @@ function testMessage($compare) {
* @access protected
*/
protected function getValue() {
return $this->_value;
return $this->value;
}
}

Expand Down Expand Up @@ -446,7 +446,7 @@ function testMessage($compare) {
* @subpackage UnitTester
*/
class ReferenceExpectation {
private $_value;
private $value;

/**
* Sets the reference value to compare against.
Expand All @@ -456,7 +456,7 @@ class ReferenceExpectation {
*/
function __construct(&$value, $message = '%s') {
$this->message = $message;
$this->_value = &$value;
$this->value = &$value;
}

/**
Expand All @@ -467,7 +467,7 @@ function __construct(&$value, $message = '%s') {
* @access public
*/
function test(&$compare) {
return SimpleTestCompatibility::isReference($this->_value, $compare);
return SimpleTestCompatibility::isReference($this->value, $compare);
}

/**
Expand All @@ -479,10 +479,10 @@ function test(&$compare) {
*/
function testMessage($compare) {
if ($this->test($compare)) {
return "Reference expectation [" . $this->dumper->describeValue($this->_value) . "]";
return "Reference expectation [" . $this->dumper->describeValue($this->value) . "]";
} else {
return "Reference expectation fails " .
$this->dumper->describeDifference($this->_value, $compare);
$this->dumper->describeDifference($this->value, $compare);
}
}

Expand Down
12 changes: 6 additions & 6 deletions test/frames_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ function testCanFocusByName() {
}

class TestOfFramesetPageInterface extends UnitTestCase {
var $_page_interface;
var $_frameset_interface;
private $page_interface;
private $frameset_interface;

function __construct() {
parent::__construct();
$this->_page_interface = $this->getPageMethods();
$this->_frameset_interface = $this->getFramesetMethods();
$this->page_interface = $this->getPageMethods();
$this->frameset_interface = $this->getFramesetMethods();
}

function assertListInAnyOrder($list, $expected) {
Expand Down Expand Up @@ -293,8 +293,8 @@ private function getFramesetMethods() {

function testFramsetHasPageInterface() {
$difference = array();
foreach ($this->_page_interface as $method) {
if (! in_array($method, $this->_frameset_interface)) {
foreach ($this->page_interface as $method) {
if (! in_array($method, $this->frameset_interface)) {
$this->fail("No [$method] in Frameset class");
return;
}
Expand Down
22 changes: 11 additions & 11 deletions test/shell_tester_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
Mock::generate('SimpleShell');

class TestOfShellTestCase extends ShellTestCase {
var $_mock_shell = false;
private $mock_shell = false;

function getShell() {
return $this->_mock_shell;
return $this->mock_shell;
}

function testGenericEquality() {
Expand All @@ -17,24 +17,24 @@ function testGenericEquality() {
}

function testExitCode() {
$this->_mock_shell = new MockSimpleShell();
$this->_mock_shell->setReturnValue('execute', 0);
$this->_mock_shell->expectOnce('execute', array('ls'));
$this->mock_shell = new MockSimpleShell();
$this->mock_shell->setReturnValue('execute', 0);
$this->mock_shell->expectOnce('execute', array('ls'));
$this->assertTrue($this->execute('ls'));
$this->assertExitCode(0);
}

function testOutput() {
$this->_mock_shell = new MockSimpleShell();
$this->_mock_shell->setReturnValue('execute', 0);
$this->_mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n");
$this->mock_shell = new MockSimpleShell();
$this->mock_shell->setReturnValue('execute', 0);
$this->mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n");
$this->assertOutput("Line 1\nLine 2\n");
}

function testOutputPatterns() {
$this->_mock_shell = new MockSimpleShell();
$this->_mock_shell->setReturnValue('execute', 0);
$this->_mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n");
$this->mock_shell = new MockSimpleShell();
$this->mock_shell->setReturnValue('execute', 0);
$this->mock_shell->setReturnValue('getOutput', "Line 1\nLine 2\n");
$this->assertOutputPattern('/line/i');
$this->assertNoOutputPattern('/line 2/');
}
Expand Down
Loading

0 comments on commit 8e367e8

Please sign in to comment.