Skip to content
Browse files

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

…perties
  • Loading branch information...
1 parent 75e04ac commit 8941448059a9e2aa9a5b6c5b82c024923366cc13 @perrick perrick committed
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
@@ -118,9 +118,9 @@ protected function keysToLowerCase($map) {
* @subpackage WebTester
*/
class SimplePageBuilder extends SimpleSaxListener {
- var $_tags;
- var $_page;
- var $_private_content_tag;
+ private $tags;
+ private $page;
+ private $private_content_tag;
/**
* Sets the builder up empty.
@@ -136,9 +136,9 @@ function __construct() {
* @access public
*/
function free() {
- unset($this->_tags);
- unset($this->_page);
- unset($this->_private_content_tags);
+ unset($this->tags);
+ unset($this->page);
+ unset($this->private_content_tags);
}
/**
@@ -149,12 +149,12 @@ function free() {
* @access public
*/
function parse($response) {
- $this->_tags = array();
- $this->_page = $this->createPage($response);
+ $this->tags = array();
+ $this->page = $this->createPage($response);
$parser = $this->createParser($this);
$parser->parse($response->getContent());
- $this->_page->acceptPageEnd();
- return $this->_page;
+ $this->page->acceptPageEnd();
+ return $this->page;
}
/**
@@ -192,30 +192,30 @@ function startElement($name, $attributes) {
return true;
}
if ($tag->getTagName() == 'label') {
- $this->_page->acceptLabelStart($tag);
+ $this->page->acceptLabelStart($tag);
$this->openTag($tag);
return true;
}
if ($tag->getTagName() == 'form') {
- $this->_page->acceptFormStart($tag);
+ $this->page->acceptFormStart($tag);
return true;
}
if ($tag->getTagName() == 'frameset') {
- $this->_page->acceptFramesetStart($tag);
+ $this->page->acceptFramesetStart($tag);
return true;
}
if ($tag->getTagName() == 'frame') {
- $this->_page->acceptFrame($tag);
+ $this->page->acceptFrame($tag);
return true;
}
- if ($tag->isPrivateContent() && ! isset($this->_private_content_tag)) {
- $this->_private_content_tag = &$tag;
+ if ($tag->isPrivateContent() && ! isset($this->private_content_tag)) {
+ $this->private_content_tag = &$tag;
}
if ($tag->expectEndTag()) {
$this->openTag($tag);
return true;
}
- $this->_page->acceptTag($tag);
+ $this->page->acceptTag($tag);
return true;
}
@@ -227,24 +227,24 @@ function startElement($name, $attributes) {
*/
function endElement($name) {
if ($name == 'label') {
- $this->_page->acceptLabelEnd();
+ $this->page->acceptLabelEnd();
return true;
}
if ($name == 'form') {
- $this->_page->acceptFormEnd();
+ $this->page->acceptFormEnd();
return true;
}
if ($name == 'frameset') {
- $this->_page->acceptFramesetEnd();
+ $this->page->acceptFramesetEnd();
return true;
}
if ($this->hasNamedTagOnOpenTagStack($name)) {
- $tag = array_pop($this->_tags[$name]);
- if ($tag->isPrivateContent() && $this->_private_content_tag->getTagName() == $name) {
- unset($this->_private_content_tag);
+ $tag = array_pop($this->tags[$name]);
+ if ($tag->isPrivateContent() && $this->private_content_tag->getTagName() == $name) {
+ unset($this->private_content_tag);
}
$this->addContentTagToOpenTags($tag);
- $this->_page->acceptTag($tag);
+ $this->page->acceptTag($tag);
return true;
}
return true;
@@ -258,7 +258,7 @@ function endElement($name) {
* @access private
*/
protected function hasNamedTagOnOpenTagStack($name) {
- return isset($this->_tags[$name]) && (count($this->_tags[$name]) > 0);
+ return isset($this->tags[$name]) && (count($this->tags[$name]) > 0);
}
/**
@@ -269,8 +269,8 @@ protected function hasNamedTagOnOpenTagStack($name) {
* @access public
*/
function addContent($text) {
- if (isset($this->_private_content_tag)) {
- $this->_private_content_tag->addContent($text);
+ if (isset($this->private_content_tag)) {
+ $this->private_content_tag->addContent($text);
} else {
$this->addContentToAllOpenTags($text);
}
@@ -284,9 +284,9 @@ function addContent($text) {
* @access private
*/
protected function addContentToAllOpenTags($text) {
- foreach (array_keys($this->_tags) as $name) {
- for ($i = 0, $count = count($this->_tags[$name]); $i < $count; $i++) {
- $this->_tags[$name][$i]->addContent($text);
+ foreach (array_keys($this->tags) as $name) {
+ for ($i = 0, $count = count($this->tags[$name]); $i < $count; $i++) {
+ $this->tags[$name][$i]->addContent($text);
}
}
}
@@ -302,9 +302,9 @@ protected function addContentTagToOpenTags(&$tag) {
if ($tag->getTagName() != 'option') {
return;
}
- foreach (array_keys($this->_tags) as $name) {
- for ($i = 0, $count = count($this->_tags[$name]); $i < $count; $i++) {
- $this->_tags[$name][$i]->addTag($tag);
+ foreach (array_keys($this->tags) as $name) {
+ for ($i = 0, $count = count($this->tags[$name]); $i < $count; $i++) {
+ $this->tags[$name][$i]->addTag($tag);
}
}
}
@@ -317,10 +317,10 @@ protected function addContentTagToOpenTags(&$tag) {
*/
protected function openTag($tag) {
$name = $tag->getTagName();
- if (! in_array($name, array_keys($this->_tags))) {
- $this->_tags[$name] = array();
+ if (! in_array($name, array_keys($this->tags))) {
+ $this->tags[$name] = array();
}
- $this->_tags[$name][] = $tag;
+ $this->tags[$name][] = $tag;
}
}
@@ -330,25 +330,25 @@ protected function openTag($tag) {
* @subpackage WebTester
*/
class SimplePage {
- var $_links;
- var $_title;
- var $_last_widget;
- var $_label;
- var $_left_over_labels;
- var $_open_forms;
- var $_complete_forms;
- var $_frameset;
- var $_frames;
- var $_frameset_nesting_level;
- var $_transport_error;
- var $_raw;
- var $_text;
- var $_sent;
- var $_headers;
- var $_method;
- var $_url;
- var $_base = false;
- var $_request_data;
+ private $links;
+ private $title;
+ private $last_widget;
+ private $label;
+ private $left_over_labels;
+ private $open_forms;
+ private $complete_forms;
+ private $frameset;
+ private $frames;
+ private $frameset_nesting_level;
+ private $transport_error;
+ private $raw;
+ private $text;
+ private $sent;
+ private $headers;
+ private $method;
+ private $url;
+ private $base = false;
+ private $request_data;
/**
* Parses a page ready to access it's contents.
@@ -356,15 +356,15 @@ class SimplePage {
* @access public
*/
function __construct($response = false) {
- $this->_links = array();
- $this->_title = false;
- $this->_left_over_labels = array();
- $this->_open_forms = array();
- $this->_complete_forms = array();
- $this->_frameset = false;
- $this->_frames = array();
- $this->_frameset_nesting_level = 0;
- $this->_text = false;
+ $this->links = array();
+ $this->title = false;
+ $this->left_over_labels = array();
+ $this->open_forms = array();
+ $this->complete_forms = array();
+ $this->frameset = false;
+ $this->frames = array();
+ $this->frameset_nesting_level = 0;
+ $this->text = false;
if ($response) {
$this->extractResponse($response);
} else {
@@ -378,13 +378,13 @@ function __construct($response = false) {
* @access private
*/
protected function extractResponse($response) {
- $this->_transport_error = $response->getError();
- $this->_raw = $response->getContent();
- $this->_sent = $response->getSent();
- $this->_headers = $response->getHeaders();
- $this->_method = $response->getMethod();
- $this->_url = $response->getUrl();
- $this->_request_data = $response->getRequestData();
+ $this->transport_error = $response->getError();
+ $this->raw = $response->getContent();
+ $this->sent = $response->getSent();
+ $this->headers = $response->getHeaders();
+ $this->method = $response->getMethod();
+ $this->url = $response->getUrl();
+ $this->request_data = $response->getRequestData();
}
/**
@@ -392,13 +392,13 @@ protected function extractResponse($response) {
* @access private
*/
protected function noResponse() {
- $this->_transport_error = 'No page fetched yet';
- $this->_raw = false;
- $this->_sent = false;
- $this->_headers = false;
- $this->_method = 'GET';
- $this->_url = false;
- $this->_request_data = false;
+ $this->transport_error = 'No page fetched yet';
+ $this->raw = false;
+ $this->sent = false;
+ $this->headers = false;
+ $this->method = 'GET';
+ $this->url = false;
+ $this->request_data = false;
}
/**
@@ -407,7 +407,7 @@ protected function noResponse() {
* @access public
*/
function getRequest() {
- return $this->_sent;
+ return $this->sent;
}
/**
@@ -416,7 +416,7 @@ function getRequest() {
* @access public
*/
function getRaw() {
- return $this->_raw;
+ return $this->raw;
}
/**
@@ -426,10 +426,10 @@ function getRaw() {
* @access public
*/
function getText() {
- if (! $this->_text) {
- $this->_text = SimpleHtmlSaxParser::normalise($this->_raw);
+ if (! $this->text) {
+ $this->text = SimpleHtmlSaxParser::normalise($this->raw);
}
- return $this->_text;
+ return $this->text;
}
/**
@@ -438,8 +438,8 @@ function getText() {
* @access public
*/
function getHeaders() {
- if ($this->_headers) {
- return $this->_headers->getRaw();
+ if ($this->headers) {
+ return $this->headers->getRaw();
}
return false;
}
@@ -450,7 +450,7 @@ function getHeaders() {
* @access public
*/
function getMethod() {
- return $this->_method;
+ return $this->method;
}
/**
@@ -459,7 +459,7 @@ function getMethod() {
* @access public
*/
function getUrl() {
- return $this->_url;
+ return $this->url;
}
/**
@@ -468,7 +468,7 @@ function getUrl() {
* @access public
*/
function getBaseUrl() {
- return $this->_base;
+ return $this->base;
}
/**
@@ -477,7 +477,7 @@ function getBaseUrl() {
* @access public
*/
function getRequestData() {
- return $this->_request_data;
+ return $this->request_data;
}
/**
@@ -486,7 +486,7 @@ function getRequestData() {
* @access public
*/
function getTransportError() {
- return $this->_transport_error;
+ return $this->transport_error;
}
/**
@@ -495,8 +495,8 @@ function getTransportError() {
* @access public
*/
function getMimeType() {
- if ($this->_headers) {
- return $this->_headers->getMimeType();
+ if ($this->headers) {
+ return $this->headers->getMimeType();
}
return false;
}
@@ -507,8 +507,8 @@ function getMimeType() {
* @access public
*/
function getResponseCode() {
- if ($this->_headers) {
- return $this->_headers->getResponseCode();
+ if ($this->headers) {
+ return $this->headers->getResponseCode();
}
return false;
}
@@ -520,8 +520,8 @@ function getResponseCode() {
* @access public
*/
function getAuthentication() {
- if ($this->_headers) {
- return $this->_headers->getAuthentication();
+ if ($this->headers) {
+ return $this->headers->getAuthentication();
}
return false;
}
@@ -533,8 +533,8 @@ function getAuthentication() {
* @access public
*/
function getRealm() {
- if ($this->_headers) {
- return $this->_headers->getRealm();
+ if ($this->headers) {
+ return $this->headers->getRealm();
}
return false;
}
@@ -589,10 +589,10 @@ function acceptTag($tag) {
} elseif ($tag->getTagName() == "title") {
$this->setTitle($tag);
} elseif ($this->isFormElement($tag->getTagName())) {
- for ($i = 0; $i < count($this->_open_forms); $i++) {
- $this->_open_forms[$i]->addWidget($tag);
+ for ($i = 0; $i < count($this->open_forms); $i++) {
+ $this->open_forms[$i]->addWidget($tag);
}
- $this->_last_widget = &$tag;
+ $this->last_widget = &$tag;
}
}
@@ -602,8 +602,8 @@ function acceptTag($tag) {
* @access public
*/
function acceptLabelStart($tag) {
- $this->_label = $tag;
- unset($this->_last_widget);
+ $this->label = $tag;
+ unset($this->last_widget);
}
/**
@@ -611,14 +611,14 @@ function acceptLabelStart($tag) {
* @access public
*/
function acceptLabelEnd() {
- if (isset($this->_label)) {
- if (isset($this->_last_widget)) {
- $this->_last_widget->setLabel($this->_label->getText());
- unset($this->_last_widget);
+ if (isset($this->label)) {
+ if (isset($this->last_widget)) {
+ $this->last_widget->setLabel($this->label->getText());
+ unset($this->last_widget);
} else {
- $this->_left_over_labels[] = SimpleTestCompatibility::copy($this->_label);
+ $this->left_over_labels[] = SimpleTestCompatibility::copy($this->label);
}
- unset($this->_label);
+ unset($this->label);
}
}
@@ -639,7 +639,7 @@ protected function isFormElement($name) {
* @access public
*/
function acceptFormStart($tag) {
- $this->_open_forms[] = new SimpleForm($tag, $this);
+ $this->open_forms[] = new SimpleForm($tag, $this);
}
/**
@@ -647,8 +647,8 @@ function acceptFormStart($tag) {
* @access public
*/
function acceptFormEnd() {
- if (count($this->_open_forms)) {
- $this->_complete_forms[] = array_pop($this->_open_forms);
+ if (count($this->open_forms)) {
+ $this->complete_forms[] = array_pop($this->open_forms);
}
}
@@ -660,9 +660,9 @@ function acceptFormEnd() {
*/
function acceptFramesetStart($tag) {
if (! $this->isLoadingFrames()) {
- $this->_frameset = $tag;
+ $this->frameset = $tag;
}
- $this->_frameset_nesting_level++;
+ $this->frameset_nesting_level++;
}
/**
@@ -671,7 +671,7 @@ function acceptFramesetStart($tag) {
*/
function acceptFramesetEnd() {
if ($this->isLoadingFrames()) {
- $this->_frameset_nesting_level--;
+ $this->frameset_nesting_level--;
}
}
@@ -684,7 +684,7 @@ function acceptFramesetEnd() {
function acceptFrame($tag) {
if ($this->isLoadingFrames()) {
if ($tag->getAttribute('src')) {
- $this->_frames[] = $tag;
+ $this->frames[] = $tag;
}
}
}
@@ -696,10 +696,10 @@ function acceptFrame($tag) {
* @access private
*/
protected function isLoadingFrames() {
- if (! $this->_frameset) {
+ if (! $this->frameset) {
return false;
}
- return ($this->_frameset_nesting_level > 0);
+ return ($this->frameset_nesting_level > 0);
}
/**
@@ -719,7 +719,7 @@ protected function linkIsAbsolute($url) {
* @access protected
*/
protected function addLink($tag) {
- $this->_links[] = $tag;
+ $this->links[] = $tag;
}
/**
@@ -728,12 +728,12 @@ protected function addLink($tag) {
* @access public
*/
function acceptPageEnd() {
- while (count($this->_open_forms)) {
- $this->_complete_forms[] = array_pop($this->_open_forms);
+ while (count($this->open_forms)) {
+ $this->complete_forms[] = array_pop($this->open_forms);
}
- foreach ($this->_left_over_labels as $label) {
- for ($i = 0, $count = count($this->_complete_forms); $i < $count; $i++) {
- $this->_complete_forms[$i]->attachLabelBySelector(
+ foreach ($this->left_over_labels as $label) {
+ for ($i = 0, $count = count($this->complete_forms); $i < $count; $i++) {
+ $this->complete_forms[$i]->attachLabelBySelector(
new SimpleById($label->getFor()),
$label->getText());
}
@@ -746,7 +746,7 @@ function acceptPageEnd() {
* @access public
*/
function hasFrames() {
- return (boolean)$this->_frameset;
+ return (boolean)$this->frameset;
}
/**
@@ -759,13 +759,13 @@ function hasFrames() {
* @access public
*/
function getFrameset() {
- if (! $this->_frameset) {
+ if (! $this->frameset) {
return false;
}
$urls = array();
- for ($i = 0; $i < count($this->_frames); $i++) {
- $name = $this->_frames[$i]->getAttribute('name');
- $url = new SimpleUrl($this->_frames[$i]->getAttribute('src'));
+ for ($i = 0; $i < count($this->frames); $i++) {
+ $name = $this->frames[$i]->getAttribute('name');
+ $url = new SimpleUrl($this->frames[$i]->getAttribute('src'));
$urls[$name ? $name : $i + 1] = $this->expandUrl($url);
}
return $urls;
@@ -789,7 +789,7 @@ function getFrames() {
*/
function getUrls() {
$all = array();
- foreach ($this->_links as $link) {
+ foreach ($this->links as $link) {
$url = $this->getUrlFromLink($link);
$all[] = $url->asString();
}
@@ -805,7 +805,7 @@ function getUrls() {
*/
function getUrlsByLabel($label) {
$matches = array();
- foreach ($this->_links as $link) {
+ foreach ($this->links as $link) {
if ($link->getText() == $label) {
$matches[] = $this->getUrlFromLink($link);
}
@@ -820,7 +820,7 @@ function getUrlsByLabel($label) {
* @access public
*/
function getUrlById($id) {
- foreach ($this->_links as $link) {
+ foreach ($this->links as $link) {
if ($link->getAttribute('id') === (string)$id) {
return $this->getUrlFromLink($link);
}
@@ -864,7 +864,7 @@ function expandUrl($url) {
*/
protected function setBase($tag) {
$url = $tag->getAttribute('href');
- $this->_base = new SimpleUrl($url);
+ $this->base = new SimpleUrl($url);
}
/**
@@ -873,7 +873,7 @@ protected function setBase($tag) {
* @access protected
*/
protected function setTitle($tag) {
- $this->_title = $tag;
+ $this->title = $tag;
}
/**
@@ -882,8 +882,8 @@ protected function setTitle($tag) {
* @access public
*/
function getTitle() {
- if ($this->_title) {
- return $this->_title->getText();
+ if ($this->title) {
+ return $this->title->getText();
}
return false;
}
@@ -897,9 +897,9 @@ function getTitle() {
* @access public
*/
function &getFormBySubmit($selector) {
- for ($i = 0; $i < count($this->_complete_forms); $i++) {
- if ($this->_complete_forms[$i]->hasSubmit($selector)) {
- return $this->_complete_forms[$i];
+ for ($i = 0; $i < count($this->complete_forms); $i++) {
+ if ($this->complete_forms[$i]->hasSubmit($selector)) {
+ return $this->complete_forms[$i];
}
}
$null = null;
@@ -915,9 +915,9 @@ function &getFormBySubmit($selector) {
* @access public
*/
function getFormByImage($selector) {
- for ($i = 0; $i < count($this->_complete_forms); $i++) {
- if ($this->_complete_forms[$i]->hasImage($selector)) {
- return $this->_complete_forms[$i];
+ for ($i = 0; $i < count($this->complete_forms); $i++) {
+ if ($this->complete_forms[$i]->hasImage($selector)) {
+ return $this->complete_forms[$i];
}
}
return null;
@@ -932,9 +932,9 @@ function getFormByImage($selector) {
* @access public
*/
function getFormById($id) {
- for ($i = 0; $i < count($this->_complete_forms); $i++) {
- if ($this->_complete_forms[$i]->getId() == $id) {
- return $this->_complete_forms[$i];
+ for ($i = 0; $i < count($this->complete_forms); $i++) {
+ if ($this->complete_forms[$i]->getId() == $id) {
+ return $this->complete_forms[$i];
}
}
return null;
@@ -950,8 +950,8 @@ function getFormById($id) {
*/
function setField($selector, $value, $position=false) {
$is_set = false;
- for ($i = 0; $i < count($this->_complete_forms); $i++) {
- if ($this->_complete_forms[$i]->setField($selector, $value, $position)) {
+ for ($i = 0; $i < count($this->complete_forms); $i++) {
+ if ($this->complete_forms[$i]->setField($selector, $value, $position)) {
$is_set = true;
}
}
@@ -967,8 +967,8 @@ function setField($selector, $value, $position=false) {
* @access public
*/
function getField($selector) {
- for ($i = 0; $i < count($this->_complete_forms); $i++) {
- $value = $this->_complete_forms[$i]->getValue($selector);
+ for ($i = 0; $i < count($this->complete_forms); $i++) {
+ $value = $this->complete_forms[$i]->getValue($selector);
if (isset($value)) {
return $value;
}
View
180 parser.php
@@ -26,10 +26,10 @@
* @subpackage WebTester
*/
class ParallelRegex {
- var $_patterns;
- var $_labels;
- var $_regex;
- var $_case;
+ private $patterns;
+ private $labels;
+ private $regex;
+ private $case;
/**
* Constructor. Starts with no patterns.
@@ -38,10 +38,10 @@ class ParallelRegex {
* @access public
*/
function __construct($case) {
- $this->_case = $case;
- $this->_patterns = array();
- $this->_labels = array();
- $this->_regex = null;
+ $this->case = $case;
+ $this->patterns = array();
+ $this->labels = array();
+ $this->regex = null;
}
/**
@@ -53,10 +53,10 @@ function __construct($case) {
* @access public
*/
function addPattern($pattern, $label = true) {
- $count = count($this->_patterns);
- $this->_patterns[$count] = $pattern;
- $this->_labels[$count] = $label;
- $this->_regex = null;
+ $count = count($this->patterns);
+ $this->patterns[$count] = $pattern;
+ $this->labels[$count] = $label;
+ $this->regex = null;
}
/**
@@ -69,7 +69,7 @@ function addPattern($pattern, $label = true) {
* @access public
*/
function match($subject, &$match) {
- if (count($this->_patterns) == 0) {
+ if (count($this->patterns) == 0) {
return false;
}
if (! preg_match($this->getCompoundedRegex(), $subject, $matches)) {
@@ -79,7 +79,7 @@ function match($subject, &$match) {
$match = $matches[0];
for ($i = 1; $i < count($matches); $i++) {
if ($matches[$i]) {
- return $this->_labels[$i - 1];
+ return $this->labels[$i - 1];
}
}
return true;
@@ -94,16 +94,16 @@ function match($subject, &$match) {
* @access private
*/
protected function getCompoundedRegex() {
- if ($this->_regex == null) {
- for ($i = 0, $count = count($this->_patterns); $i < $count; $i++) {
- $this->_patterns[$i] = '(' . str_replace(
+ if ($this->regex == null) {
+ for ($i = 0, $count = count($this->patterns); $i < $count; $i++) {
+ $this->patterns[$i] = '(' . str_replace(
array('/', '(', ')'),
array('\/', '\(', '\)'),
- $this->_patterns[$i]) . ')';
+ $this->patterns[$i]) . ')';
}
- $this->_regex = "/" . implode("|", $this->_patterns) . "/" . $this->getPerlMatchingFlags();
+ $this->regex = "/" . implode("|", $this->patterns) . "/" . $this->getPerlMatchingFlags();
}
- return $this->_regex;
+ return $this->regex;
}
/**
@@ -112,7 +112,7 @@ protected function getCompoundedRegex() {
* @access private
*/
protected function getPerlMatchingFlags() {
- return ($this->_case ? "msS" : "msSi");
+ return ($this->case ? "msS" : "msSi");
}
}
@@ -122,7 +122,7 @@ protected function getPerlMatchingFlags() {
* @subpackage WebTester
*/
class SimpleStateStack {
- var $_stack;
+ private $stack;
/**
* Constructor. Starts in named state.
@@ -130,7 +130,7 @@ class SimpleStateStack {
* @access public
*/
function __construct($start) {
- $this->_stack = array($start);
+ $this->stack = array($start);
}
/**
@@ -139,7 +139,7 @@ function __construct($start) {
* @access public
*/
function getCurrent() {
- return $this->_stack[count($this->_stack) - 1];
+ return $this->stack[count($this->stack) - 1];
}
/**
@@ -149,7 +149,7 @@ function getCurrent() {
* @access public
*/
function enter($state) {
- array_push($this->_stack, $state);
+ array_push($this->stack, $state);
}
/**
@@ -160,10 +160,10 @@ function enter($state) {
* @access public
*/
function leave() {
- if (count($this->_stack) == 1) {
+ if (count($this->stack) == 1) {
return false;
}
- array_pop($this->_stack);
+ array_pop($this->stack);
return true;
}
}
@@ -178,11 +178,11 @@ function leave() {
* @subpackage WebTester
*/
class SimpleLexer {
- var $_regexes;
- var $_parser;
- var $_mode;
- var $_mode_handlers;
- var $_case;
+ private $regexes;
+ private $parser;
+ private $mode;
+ private $mode_handlers;
+ private $case;
/**
* Sets up the lexer in case insensitive matching
@@ -194,11 +194,11 @@ class SimpleLexer {
* @access public
*/
function __construct($parser, $start = "accept", $case = false) {
- $this->_case = $case;
- $this->_regexes = array();
- $this->_parser = $parser;
- $this->_mode = new SimpleStateStack($start);
- $this->_mode_handlers = array($start => $start);
+ $this->case = $case;
+ $this->regexes = array();
+ $this->parser = $parser;
+ $this->mode = new SimpleStateStack($start);
+ $this->mode_handlers = array($start => $start);
}
/**
@@ -213,12 +213,12 @@ function __construct($parser, $start = "accept", $case = false) {
* @access public
*/
function addPattern($pattern, $mode = "accept") {
- if (! isset($this->_regexes[$mode])) {
- $this->_regexes[$mode] = new ParallelRegex($this->_case);
+ if (! isset($this->regexes[$mode])) {
+ $this->regexes[$mode] = new ParallelRegex($this->case);
}
- $this->_regexes[$mode]->addPattern($pattern);
- if (! isset($this->_mode_handlers[$mode])) {
- $this->_mode_handlers[$mode] = $mode;
+ $this->regexes[$mode]->addPattern($pattern);
+ if (! isset($this->mode_handlers[$mode])) {
+ $this->mode_handlers[$mode] = $mode;
}
}
@@ -236,12 +236,12 @@ function addPattern($pattern, $mode = "accept") {
* @access public
*/
function addEntryPattern($pattern, $mode, $new_mode) {
- if (! isset($this->_regexes[$mode])) {
- $this->_regexes[$mode] = new ParallelRegex($this->_case);
+ if (! isset($this->regexes[$mode])) {
+ $this->regexes[$mode] = new ParallelRegex($this->case);
}
- $this->_regexes[$mode]->addPattern($pattern, $new_mode);
- if (! isset($this->_mode_handlers[$new_mode])) {
- $this->_mode_handlers[$new_mode] = $new_mode;
+ $this->regexes[$mode]->addPattern($pattern, $new_mode);
+ if (! isset($this->mode_handlers[$new_mode])) {
+ $this->mode_handlers[$new_mode] = $new_mode;
}
}
@@ -254,12 +254,12 @@ function addEntryPattern($pattern, $mode, $new_mode) {
* @access public
*/
function addExitPattern($pattern, $mode) {
- if (! isset($this->_regexes[$mode])) {
- $this->_regexes[$mode] = new ParallelRegex($this->_case);
+ if (! isset($this->regexes[$mode])) {
+ $this->regexes[$mode] = new ParallelRegex($this->case);
}
- $this->_regexes[$mode]->addPattern($pattern, "__exit");
- if (! isset($this->_mode_handlers[$mode])) {
- $this->_mode_handlers[$mode] = $mode;
+ $this->regexes[$mode]->addPattern($pattern, "__exit");
+ if (! isset($this->mode_handlers[$mode])) {
+ $this->mode_handlers[$mode] = $mode;
}
}
@@ -276,12 +276,12 @@ function addExitPattern($pattern, $mode) {
* @access public
*/
function addSpecialPattern($pattern, $mode, $special) {
- if (! isset($this->_regexes[$mode])) {
- $this->_regexes[$mode] = new ParallelRegex($this->_case);
+ if (! isset($this->regexes[$mode])) {
+ $this->regexes[$mode] = new ParallelRegex($this->case);
}
- $this->_regexes[$mode]->addPattern($pattern, "_$special");
- if (! isset($this->_mode_handlers[$special])) {
- $this->_mode_handlers[$special] = $special;
+ $this->regexes[$mode]->addPattern($pattern, "_$special");
+ if (! isset($this->mode_handlers[$special])) {
+ $this->mode_handlers[$special] = $special;
}
}
@@ -292,7 +292,7 @@ function addSpecialPattern($pattern, $mode, $special) {
* @access public
*/
function mapHandler($mode, $handler) {
- $this->_mode_handlers[$mode] = $handler;
+ $this->mode_handlers[$mode] = $handler;
}
/**
@@ -306,7 +306,7 @@ function mapHandler($mode, $handler) {
* @access public
*/
function parse($raw) {
- if (! isset($this->_parser)) {
+ if (! isset($this->parser)) {
return false;
}
$length = strlen($raw);
@@ -352,16 +352,16 @@ protected function dispatchTokens($unmatched, $matched, $mode = false) {
if (! $this->invokeParser($matched, LEXER_EXIT)) {
return false;
}
- return $this->_mode->leave();
+ return $this->mode->leave();
}
if ($this->isSpecialMode($mode)) {
- $this->_mode->enter($this->decodeSpecial($mode));
+ $this->mode->enter($this->decodeSpecial($mode));
if (! $this->invokeParser($matched, LEXER_SPECIAL)) {
return false;
}
- return $this->_mode->leave();
+ return $this->mode->leave();
}
- $this->_mode->enter($mode);
+ $this->mode->enter($mode);
return $this->invokeParser($matched, LEXER_ENTER);
}
@@ -413,8 +413,8 @@ protected function invokeParser($content, $is_match) {
if (($content === '') || ($content === false)) {
return true;
}
- $handler = $this->_mode_handlers[$this->_mode->getCurrent()];
- return $this->_parser->$handler($content, $is_match);
+ $handler = $this->mode_handlers[$this->mode->getCurrent()];
+ return $this->parser->$handler($content, $is_match);
}
/**
@@ -432,7 +432,7 @@ protected function invokeParser($content, $is_match) {
* @access private
*/
protected function reduce($raw) {
- if ($action = $this->_regexes[$this->_mode->getCurrent()]->match($raw, $match)) {
+ if ($action = $this->regexes[$this->mode->getCurrent()]->match($raw, $match)) {
$unparsed_character_count = strpos($raw, $match);
$unparsed = substr($raw, 0, $unparsed_character_count);
$raw = substr($raw, $unparsed_character_count + strlen($match));
@@ -541,11 +541,11 @@ protected function addAttributeTokens() {
* @subpackage WebTester
*/
class SimpleHtmlSaxParser {
- var $_lexer;
- var $_listener;
- var $_tag;
- var $_attributes;
- var $_current_attribute;
+ private $lexer;
+ private $listener;
+ private $tag;
+ private $attributes;
+ private $current_attribute;
/**
* Sets the listener.
@@ -553,11 +553,11 @@ class SimpleHtmlSaxParser {
* @access public
*/
function __construct($listener) {
- $this->_listener = $listener;
- $this->_lexer = $this->createLexer($this);
- $this->_tag = '';
- $this->_attributes = array();
- $this->_current_attribute = '';
+ $this->listener = $listener;
+ $this->lexer = $this->createLexer($this);
+ $this->tag = '';
+ $this->attributes = array();
+ $this->current_attribute = '';
}
/**
@@ -568,7 +568,7 @@ function __construct($listener) {
* @access public
*/
function parse($raw) {
- return $this->_lexer->parse($raw);
+ return $this->lexer->parse($raw);
}
/**
@@ -594,20 +594,20 @@ static function createLexer(&$parser) {
*/
function acceptStartToken($token, $event) {
if ($event == LEXER_ENTER) {
- $this->_tag = strtolower(substr($token, 1));
+ $this->tag = strtolower(substr($token, 1));
return true;
}
if ($event == LEXER_EXIT) {
- $success = $this->_listener->startElement(
- $this->_tag,
- $this->_attributes);
- $this->_tag = '';
- $this->_attributes = array();
+ $success = $this->listener->startElement(
+ $this->tag,
+ $this->attributes);
+ $this->tag = '';
+ $this->attributes = array();
return $success;
}
if ($token != '=') {
- $this->_current_attribute = strtolower(SimpleHtmlSaxParser::decodeHtml($token));
- $this->_attributes[$this->_current_attribute] = '';
+ $this->current_attribute = strtolower(SimpleHtmlSaxParser::decodeHtml($token));
+ $this->attributes[$this->current_attribute] = '';
}
return true;
}
@@ -624,7 +624,7 @@ function acceptEndToken($token, $event) {
if (! preg_match('/<\/(.*)>/', $token, $matches)) {
return false;
}
- return $this->_listener->endElement(strtolower($matches[1]));
+ return $this->listener->endElement(strtolower($matches[1]));
}
/**
@@ -635,13 +635,13 @@ function acceptEndToken($token, $event) {
* @access public
*/
function acceptAttributeToken($token, $event) {
- if ($this->_current_attribute) {
+ if ($this->current_attribute) {
if ($event == LEXER_UNMATCHED) {
- $this->_attributes[$this->_current_attribute] .=
+ $this->attributes[$this->current_attribute] .=
SimpleHtmlSaxParser::decodeHtml($token);
}
if ($event == LEXER_SPECIAL) {
- $this->_attributes[$this->_current_attribute] .=
+ $this->attributes[$this->current_attribute] .=
preg_replace('/^=\s*/' , '', SimpleHtmlSaxParser::decodeHtml($token));
}
}
@@ -667,7 +667,7 @@ function acceptEntityToken($token, $event) {
* @access public
*/
function acceptTextToken($token, $event) {
- return $this->_listener->addContent($token);
+ return $this->listener->addContent($token);
}
/**
View
44 reflection_php5.php
@@ -12,7 +12,7 @@
* @subpackage UnitTester
*/
class SimpleReflection {
- private $_interface;
+ private $interface;
/**
* Stashes the class/interface.
@@ -20,7 +20,7 @@ class SimpleReflection {
* 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
32 remote.php
@@ -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
34 reporter.php
@@ -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,7 +369,7 @@ protected function shouldRunTest($test_case, $method) {
* @access private
*/
protected function on() {
- $this->_on = true;
+ $this->on = true;
}
/**
@@ -377,7 +377,7 @@ protected function on() {
* @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();
}
}
View
36 scorer.php
@@ -19,20 +19,20 @@
* @abstract
*/
class SimpleScorer {
- private $_passes;
- private $_fails;
- private $_exceptions;
- private $_is_dry_run;
+ private $passes;
+ private $fails;
+ private $exceptions;
+ private $is_dry_run;
/**
* Starts the test run with no results.
* @access public
*/
function __construct() {
- $this->_passes = 0;
- $this->_fails = 0;
- $this->_exceptions = 0;
- $this->_is_dry_run = false;
+ $this->passes = 0;
+ $this->fails = 0;
+ $this->exceptions = 0;
+ $this->is_dry_run = false;
}
/**
@@ -43,7 +43,7 @@ function __construct() {
* @access public
*/
function makeDry($is_dry = true) {
- $this->_is_dry_run = $is_dry;
+ $this->is_dry_run = $is_dry;
}
/**
@@ -53,7 +53,7 @@ function makeDry($is_dry = true) {
* @access public
*/
function shouldInvoke($test_case_name, $method) {
- return ! $this->_is_dry_run;
+ return ! $this->is_dry_run;
}
/**
@@ -75,7 +75,7 @@ function createInvoker($invoker) {
* @access public
*/
function getStatus() {
- if ($this->_exceptions + $this->_fails > 0) {
+ if ($this->exceptions + $this->fails > 0) {
return false;
}
return true;
@@ -136,7 +136,7 @@ function paintMethodEnd($test_name) {
* @access public
*/
function paintPass($message) {
- $this->_passes++;
+ $this->passes++;
}
/**
@@ -145,7 +145,7 @@ function paintPass($message) {
* @access public
*/
function paintFail($message) {
- $this->_fails++;
+ $this->fails++;
}
/**
@@ -155,7 +155,7 @@ function paintFail($message) {
* @access public
*/
function paintError($message) {
- $this->_exceptions++;
+ $this->exceptions++;
}
/**
@@ -164,7 +164,7 @@ function paintError($message) {
* @access public
*/
function paintException($exception) {
- $this->_exceptions++;
+ $this->exceptions++;
}
/**
@@ -181,7 +181,7 @@ function paintSkip($message) {
* @access public
*/
function getPassCount() {
- return $this->_passes;
+ return $this->passes;
}
/**
@@ -190,7 +190,7 @@ function getPassCount() {
* @access public
*/
function getFailCount() {
- return $this->_fails;
+ return $this->fails;
}
/**
@@ -200,7 +200,7 @@ function getFailCount() {
* @access public
*/
function getExceptionCount() {
- return $this->_exceptions;
+ return $this->exceptions;
}
/**
View
28 selector.php
@@ -20,14 +20,14 @@
* @subpackage WebTester
*/
class SimpleByName {
- private $_name;
+ private $name;
/**
* Stashes the name for later comparison.
* @param string $name Name attribute to match.
*/
function __construct($name) {
- $this->_name = $name;
+ $this->name = $name;
}
/**
@@ -35,7 +35,7 @@ function __construct($name) {
* @returns string $name Name to match.
*/
function getName() {
- return $this->_name;
+ return $this->name;
}
/**
@@ -44,7 +44,7 @@ function getName() {
* @access public
*/
function isMatch($widget) {
- return ($widget->getName() == $this->_name);
+ return ($widget->getName() == $this->name);
}
}
@@ -55,14 +55,14 @@ function isMatch($widget) {
* @subpackage WebTester
*/
class SimpleByLabel {
- private $_label;
+ private $label;
/**
* Stashes the name for later comparison.
* @param string $label Visible text to match.
*/
function __construct($label) {
- $this->_label = $label;
+ $this->label = $label;
}
/**
@@ -75,7 +75,7 @@ function isMatch($widget) {
if (! method_exists($widget, 'isLabel')) {
return false;
}
- return $widget->isLabel($this->_label);
+ return $widget->isLabel($this->label);
}
}
@@ -86,14 +86,14 @@ function isMatch($widget) {
* @subpackage WebTester
*/
class SimpleById {
- private $_id;
+ private $id;
/**
* Stashes the name for later comparison.
* @param string $id ID atribute to match.
*/
function __construct($id) {
- $this->_id = $id;
+ $this->id = $id;
}
/**
@@ -102,7 +102,7 @@ function __construct($id) {