diff options
Diffstat (limited to 'tests/test_tools')
42 files changed, 764 insertions, 615 deletions
diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php new file mode 100755 index 00000000..23dfeb61 --- /dev/null +++ b/tests/test_tools/PradoGenericSelenium2Test.php @@ -0,0 +1,230 @@ +<?php +require_once 'PHPUnit/Extensions/Selenium2TestCase.php'; + +// TODO: stub +class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase +{ + public static $browsers = array( +/* + array( + 'name' => 'Firefox on OSX', + 'browserName' => '*firefox', + 'host' => '127.0.0.1', + 'port' => 4444, + ), +*/ + array( + 'name' => 'Chrome on OSX', + 'browserName' => 'chrome', + 'sessionStrategy' => 'shared', + 'host' => '127.0.0.1', + 'port' => 4444, + ), +/* + array( + 'name' => 'Firefox on WindowsXP', + 'browserName' => '*firefox', + 'host' => '127.0.0.1', + 'port' => 4445, + ), + array( + 'name' => 'Internet Explorer 8 on WindowsXP', + 'browserName' => '*iehta', + 'host' => '127.0.0.1', + 'port' => 4445, + ) +*/ + ); + + static $baseurl='http://127.0.0.1/prado-master/tests/FunctionalTests/'; + + static $timeout=5; //seconds + + protected function setUp() + { + self::shareSession(true); + $this->setBrowserUrl(static::$baseurl); + $this->setSeleniumServerRequestsTimeout(static::$timeout); + } + + protected function assertAttribute($idattr, $txt) + { + list($id, $attr) = explode('@', $idattr); + + $element = $this->getElement($id); + $value=$element->attribute($attr); + + if(strpos($txt, 'regexp:')===0) + { + $this->assertRegExp('/'.substr($txt, 7).'/', $value); + } else { + $this->assertEquals($txt, $value); + } + } + + protected function getElement($id) + { + if(strpos($id, 'id=')===0) { + return $this->byId(substr($id, 3)); + } elseif(strpos($id, 'name=')===0) { + return $this->byName(substr($id, 5)); + } elseif(strpos($id, '//')===0) { + return $this->byXPath($id); + } elseif(strpos($id, '$')!==false) { + return $this->byName($id); + } else { + return $this->byId($id); + } + } + + protected function assertText($id, $txt) + { + $this->assertEquals($txt, $this->getElement($id)->text()); + } + + protected function assertValue($id, $txt) + { + $this->assertEquals($txt, $this->getElement($id)->value()); + } + + protected function assertVisible($id) + { + $this->assertTrue($this->getElement($id)->displayed()); + } + + protected function assertNotVisible($id) + { + $this->assertFalse($this->getElement($id)->displayed()); + } + + protected function assertElementPresent($id) + { + $this->assertTrue($this->getElement($id)!==null); + } + + protected function assertElementNotPresent($id) + { + try { + $el = $this->getElement($id); + } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { + $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement, $e->getCode()); + return; + } + $this->fail('The element '.$id.' shouldn\'t exist.'); + } + + protected function type($id, $txt='') + { + $element = $this->getElement($id); + $element->clear(); + $element->value($txt); + // trigger onblur() event + $this->byCssSelector('body')->click(); + } + + protected function typeSpecial($id, $txt='') + { + $element = $this->getElement($id); + // clear the textbox without using clear() that triggers onchange() + // the idea is to focus the input, move to the end of the text and hit + // backspace until the input is empty. + // on multiline textareas, line feeds can make this difficult, so we mix + // sequences of end+backspace and start+delete + + $element->click(); + while(strlen($element->value())>0) + { + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::END); + // the number 100 is purely empiric + for($i=0;$i<100;$i++) + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::BACKSPACE); + + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::HOME); + // the number 100 is purely empiric + for($i=0;$i<100;$i++) + $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::DELETE); + } + + $element->value($txt); + // trigger onblur() event + $this->byCssSelector('body')->click(); + } + + protected function select($id, $value) + { + $select = parent::select($this->getElement($id)); + $select->clearSelectedOptions(); + + $select->selectOptionByLabel($value); + } + + protected function selectAndWait($id, $value) + { + $this->select($id, $value); + } + + protected function addSelection($id, $value) + { + parent::select($this->getElement($id))->selectOptionByLabel($value); + } + + protected function getSelectedLabels($id) + { + return parent::select($this->getElement($id))->selectedLabels(); + } + + protected function getSelectOptions($id) + { + return parent::select($this->getElement($id))->selectOptionLabels(); + } + + protected function assertSelectedIndex($id, $value) + { + $options=parent::select($this->getElement($id))->selectOptionValues(); + $curval=parent::select($this->getElement($id))->selectedValue(); + + $i=0; + foreach($options as $option) + { + if($option==$curval) + { + $this->assertEquals($i, $value); + return; + } + $i++; + } + $this->fail('Current value '.$curval.' not found in: '.implode(',', $options)); + } + + protected function assertSelected($id, $label) + { + $this->assertSame($label, parent::select($this->getElement($id))->selectedLabel()); + } + + protected function assertNotSomethingSelected($id) + { + $this->assertSame(array(), $this->getSelectedLabels($id)); + } + + protected function assertSelectedValue($id, $index) + { + $this->assertSame($index, parent::select($this->getElement($id))->selectedValue()); + } + + protected function assertAlertNotPresent() + { + try { + $foo=$this->alertText(); + } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { + $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoAlertOpenError, $e->getCode()); + return; + } + $this->fail('Failed asserting no alert is open'); + } + + protected function pause($msec) + { + usleep($msec*1000); + } + +}
\ No newline at end of file diff --git a/tests/test_tools/PradoGenericSeleniumTest.php b/tests/test_tools/PradoGenericSeleniumTest.php deleted file mode 100644 index 2c9ceb21..00000000 --- a/tests/test_tools/PradoGenericSeleniumTest.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; -require_once 'PHPUnit/Extensions/Selenium2TestCase.php'; - -class PradoGenericSeleniumTest extends PHPUnit_Extensions_SeleniumTestCase -{ - static $browser='*googlechrome'; - static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/'; - - protected function setUp() - { - $this->shareSession(true); - $this->setBrowser(static::$browser); - $this->setBrowserUrl(static::$baseurl); - } - - protected function tearDown() - { - } -} - -// TODO: stub -class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase -{ - static $browser='chrome'; - static $baseurl='http://127.0.0.1/prado-3.2/tests/FunctionalTests/'; - - protected function setUp() - { - $this->setBrowser(static::$browser); - $this->setBrowserUrl(static::$baseurl); - } - - protected function open($url) - { - $this->setBrowserUrl(static::$baseurl.$url); - } - - protected function tearDown() - { - } -}
\ No newline at end of file diff --git a/tests/test_tools/README.txt b/tests/test_tools/README.txt index cfa02abe..6bc3aa79 100644 --- a/tests/test_tools/README.txt +++ b/tests/test_tools/README.txt @@ -4,7 +4,7 @@ Functional tests are browser based that tests the overall functional of a Prado === Writing Tests === -Lets test some part of a Prado application. Create a new php file, e.g. +Lets test some part of a Prado application. Create a new php file, e.g. testExample1.php @@ -21,11 +21,10 @@ class testExample1 extends SeleniumTestCase { //using xpath to find the button with value "Click Me!" $this->click('//input[@value="Click Me!"]'); - + //..more commands and assertions } } -?> </php> === Tests as part of Example code === @@ -50,9 +49,9 @@ class testMyButtonExample extends SeleniumTestCase { //get the test page url $page = Prado::getApplication()->getTestPage(__FILE__); - + //open MyButtonExample page - $this->open($page); + $this->open($page); } function testButtonClick() @@ -62,7 +61,6 @@ class testMyButtonExample extends SeleniumTestCase $this->click('//input[@value="Hello World!"]'); } } -?> </php> File: MyButtonExample.tpl @@ -108,7 +106,7 @@ Select the element with the specified @id attribute. If no match is found, sele Find an element using JavaScript traversal of the HTML Document Object Model. DOM locators ''must'' begin with "document.". * dom=document.forms['myForm'].myDropdown * dom=document.images[56] - + ==== '''xpath='''''xpathExpression''==== Locate an element using an XPath expression. XPath locators ''must'' begin with "//". * xpath=//img[@alt='The image alt text'] @@ -133,15 +131,15 @@ Select Option Specifiers provide different ways of specifying options of an HTML matches options based on their labels, i.e. the visible text. * label=regexp:^[Oo]ther -==== value=valuePattern ==== +==== value=valuePattern ==== matches options based on their values. * value=other -==== id=id ==== +==== id=id ==== matches options based on their ids. * id=option1 -==== index=index ==== +==== index=index ==== matches an option based on its index (offset from zero). * index=2 @@ -174,8 +172,8 @@ Selenium Actions examples: - open /mypage - open http://localhost/ + open /mypage + open http://localhost/ click( elementLocator ) @@ -183,9 +181,9 @@ Selenium Actions examples: - click aCheckbox - clickAndWait submitButton - clickAndWait anyLink + click aCheckbox + clickAndWait submitButton + clickAndWait anyLink note: Selenium will always automatically click on a popup dialog raised by the alert() or confirm() methods. (The exception is those raised during 'onload', which are not yet handled by Selenium). You must use [verify|assert]Alert or [verify|assert]Confirmation to tell Selenium that you expect the popup dialog. You may use chooseCancelOnNextConfirmation to click 'cancel' on the next confirmation dialog instead of clicking 'OK'. @@ -222,8 +220,8 @@ Selenium Actions examples: - selectWindow myPopupWindow - selectWindow null + selectWindow myPopupWindow + selectWindow null goBack() @@ -231,7 +229,7 @@ Selenium Actions examples: - goBack + goBack close() @@ -239,7 +237,7 @@ Selenium Actions examples: - close + close pause( milliseconds ) @@ -247,8 +245,8 @@ Selenium Actions examples: - pause 5000 - pause 2000 + pause 5000 + pause 2000 fireEvent( elementLocator, eventName ) @@ -310,7 +308,7 @@ Selenium Actions examples: - chooseCancelOnNextConfirmation + chooseCancelOnNextConfirmation answerOnNextPrompt( answerString ) @@ -318,7 +316,7 @@ Selenium Actions examples: - answerOnNextPrompt Kangaroo + answerOnNextPrompt Kangaroo Selenium Checks @@ -330,8 +328,8 @@ Selenium Checks examples: - verifyLocation /mypage - assertLocation /mypage + verifyLocation /mypage + assertLocation /mypage assertTitle( titlePattern ) @@ -339,8 +337,8 @@ Selenium Checks examples: - verifyTitle My Page - assertTitle My Page + verifyTitle My Page + assertTitle My Page assertValue( inputLocator, valuePattern ) @@ -396,8 +394,8 @@ Selenium Checks examples: - verifyTextPresent You are now logged in. - assertTextPresent You are now logged in. + verifyTextPresent You are now logged in. + assertTextPresent You are now logged in. assertTextNotPresent( text ) @@ -409,8 +407,8 @@ Selenium Checks examples: - verifyElementPresent submitButton - assertElementPresent //img[@alt='foo'] + verifyElementPresent submitButton + assertElementPresent //img[@alt='foo'] assertElementNotPresent( elementLocator ) @@ -418,8 +416,8 @@ Selenium Checks examples: - verifyElementNotPresent cancelButton - assertElementNotPresent cancelButton + verifyElementNotPresent cancelButton + assertElementNotPresent cancelButton assertTable( cellAddress, valuePattern ) @@ -436,8 +434,8 @@ Selenium Checks examples: - verifyVisible postcode - assertVisible postcode + verifyVisible postcode + assertVisible postcode assertNotVisible( elementLocator ) @@ -445,8 +443,8 @@ Selenium Checks examples: - verifyNotVisible postcode - assertNotVisible postcode + verifyNotVisible postcode + assertNotVisible postcode verifyEditable / assertEditable( inputLocator ) @@ -454,8 +452,8 @@ Selenium Checks examples: - verifyEditable shape - assertEditable colour + verifyEditable shape + assertEditable colour assertNotEditable( inputLocator ) @@ -473,8 +471,8 @@ Selenium Checks examples: - verifyAlert Invalid Phone Number - assertAlert Invalid Phone Number + verifyAlert Invalid Phone Number + assertAlert Invalid Phone Number assertConfirmation( messagePattern ) @@ -488,8 +486,8 @@ Selenium Checks examples: - assertConfirmation Remove this user? - verifyConfirmation Are you sure? + assertConfirmation Remove this user? + verifyConfirmation Are you sure? assertPrompt( messagePattern ) @@ -499,9 +497,9 @@ Selenium Checks examples: - answerOnNextPrompt Joe - click id=delegate - verifyPrompt Delegate to who? + answerOnNextPrompt Joe + click id=delegate + verifyPrompt Delegate to who? Parameter construction and Variables diff --git a/tests/test_tools/phpunit_bootstrap.php b/tests/test_tools/phpunit_bootstrap.php index 1154e5fc..c1cb423f 100644 --- a/tests/test_tools/phpunit_bootstrap.php +++ b/tests/test_tools/phpunit_bootstrap.php @@ -13,6 +13,8 @@ set_include_path(PRADO_FRAMEWORK_DIR.PATH_SEPARATOR.get_include_path()); // coverage tests waste a lot of memory! ini_set('memory_limit', '1G'); +date_default_timezone_set('UTC'); + if (!@include_once VENDOR_DIR.'/autoload.php') { die('You must set up the project dependencies, run the following commands: wget http://getcomposer.org/composer.phar @@ -22,4 +24,4 @@ if (!@include_once VENDOR_DIR.'/autoload.php') { require_once(PRADO_FRAMEWORK_DIR.'/prado.php'); // for FunctionalTests -require_once(__DIR__.'/PradoGenericSeleniumTest.php');
\ No newline at end of file +require_once(__DIR__.'/PradoGenericSelenium2Test.php');
\ No newline at end of file diff --git a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php index abd10076..f3ae2391 100644 --- a/tests/test_tools/simpletest/HtmlReporterWithCoverage.php +++ b/tests/test_tools/simpletest/HtmlReporterWithCoverage.php @@ -1,11 +1,11 @@ <?php -if (!defined('T_ML_COMMENT')) +if (!defined('T_ML_COMMENT')) define('T_ML_COMMENT', T_COMMENT); -else +else define('T_DOC_COMMENT', T_ML_COMMENT); -class HtmlReporterWithCoverage extends HtmlReporter +class HtmlReporterWithCoverage extends HtmlReporter { protected $coverage = array(); @@ -19,7 +19,7 @@ class HtmlReporterWithCoverage extends HtmlReporter $this->base_dir = $base_dir; } - function paintHeader($test_name, $charset="UTF-8") + function paintHeader($test_name, $charset="UTF-8") { $this->sendNoCacheHeaders(); header('Content-Type: text/html; Charset='.$charset); @@ -31,30 +31,30 @@ class HtmlReporterWithCoverage extends HtmlReporter print "</head>\n<body>\n"; print "<h1>$test_name</h1>\n"; flush(); - - if (extension_loaded('xdebug')) + + if (extension_loaded('xdebug')) xdebug_start_code_coverage(XDEBUG_CC_UNUSED); - } + } /** * */ - function _getCss() + function _getCss() { $contents = parent::_getCss()."\n "; $contents .= ' - .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} - .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } - .coverage {margin: 0.4em; } + .bar { float: left; display: inline; border: 1px solid #eee; width: 300px; white-space: nowrap;} + .percentage { float: left; background-color: #eef; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 0.65em; padding: 5px; margin-right: } + .coverage {margin: 0.4em; } .coverage a { padding-left: 0.5em; } - .coverage:after { - content: "."; - display: block; - height: 0; - clear: both; + .coverage:after { + content: "."; + display: block; + height: 0; + clear: both; visibility: hidden; } .coverage {display: inline-block;} @@ -66,9 +66,9 @@ class HtmlReporterWithCoverage extends HtmlReporter Return $contents; } - function paintFooter($test_name) + function paintFooter($test_name) { - if (extension_loaded('xdebug')) + if (extension_loaded('xdebug')) { $this->coverage = xdebug_get_code_coverage(); xdebug_stop_code_coverage(); @@ -93,10 +93,10 @@ class HtmlReporterWithCoverage extends HtmlReporter $dir = dirname(__FILE__); if(count($this->coverage) > 0) print '<h2>Code Coverage</h2>'; - - - ksort($this->coverage); - + + + ksort($this->coverage); + $details = array(); foreach($this->coverage as $file => $coverage) { @@ -110,7 +110,7 @@ class HtmlReporterWithCoverage extends HtmlReporter $width = $percentage * 3; $filename = str_replace($this->base_dir, '',$file); $link = $this->constructURL($filename, $coverage); - + $detail['total'] = $total; $detail['executed'] = $executed; $detail['width'] = $width; @@ -150,7 +150,7 @@ class HtmlReporterWithCoverage extends HtmlReporter } -class HTMLCoverageReport extends HtmlReporter +class HTMLCoverageReport extends HtmlReporter { protected $file; protected $lines; @@ -184,7 +184,7 @@ class HTMLCoverageReport extends HtmlReporter $this->paintFooter(); } - function paintHeader($file, $charset="UTF-8") + function paintHeader($file, $charset="UTF-8") { $total = $this->codelines($this->file); $executed = count($this->lines); @@ -218,21 +218,21 @@ class HTMLCoverageReport extends HtmlReporter $lines = ''; - foreach ($tokens as $token) + foreach ($tokens as $token) { - if (is_string($token)) + if (is_string($token)) { // simple 1-character token $lines .= $token; - } - else + } + else { // token array list($id, $text) = $token; - switch ($id) - { - case T_COMMENT: + switch ($id) + { + case T_COMMENT: case T_ML_COMMENT: // we've defined this case T_DOC_COMMENT: // and this // no action on comments @@ -265,4 +265,3 @@ class HTMLCoverageReport extends HtmlReporter } } -?> diff --git a/tests/test_tools/simpletest/authentication.php b/tests/test_tools/simpletest/authentication.php index cae366b3..86b68402 100644 --- a/tests/test_tools/simpletest/authentication.php +++ b/tests/test_tools/simpletest/authentication.php @@ -234,5 +234,4 @@ 'Authorization: Basic ' . base64_encode("$username:$password")); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/browser.php b/tests/test_tools/simpletest/browser.php index 44c8ddd4..410b18b9 100644 --- a/tests/test_tools/simpletest/browser.php +++ b/tests/test_tools/simpletest/browser.php @@ -220,7 +220,7 @@ function useFrames() { $this->_ignore_frames = false; } - + /** * Switches off cookie sending and recieving. * @access public @@ -228,7 +228,7 @@ function ignoreCookies() { $this->_user_agent->ignoreCookies(); } - + /** * Switches back on the cookie sending and recieving. * @access public @@ -257,7 +257,7 @@ } return $frameset; } - + /** * Assembles the parsing machinery and actually parses * a single page. Frees all of the builder memory and so @@ -1053,5 +1053,4 @@ } return $raw; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/collector.php b/tests/test_tools/simpletest/collector.php index 5bcde179..ded847c9 100644 --- a/tests/test_tools/simpletest/collector.php +++ b/tests/test_tools/simpletest/collector.php @@ -1,12 +1,11 @@ <?php /** - * This file contains the following classes: {@link SimpleCollector}, + * This file contains the following classes: {@link SimpleCollector}, * {@link SimplePatternCollector}. - * + * * @author Travis Swicegood <development@domain51.com> * @package SimpleTest * @subpackage UnitTester - * @version $Id: collector.php 1398 2006-09-08 19:31:03Z xue $ */ /** @@ -17,7 +16,7 @@ * @subpackage UnitTester */ class SimpleCollector { - + /** * Strips off any kind of slash at the end so as to normalise the path * @@ -25,12 +24,12 @@ class SimpleCollector { */ function _removeTrailingSlash($path) { return preg_replace('|[\\/]$|', '', $path); - + /** * @internal * Try benchmarking the following. It's more code, but by not using the - * regex, it may be faster? Also, shouldn't be looking for - * DIRECTORY_SEPERATOR instead of a manual "/"? + * regex, it may be faster? Also, shouldn't be looking for + * DIRECTORY_SEPERATOR instead of a manual "/"? */ if (substr($path, -1) == DIRECTORY_SEPERATOR) { return substr($path, 0, -1); @@ -54,12 +53,12 @@ class SimpleCollector { closedir($handle); } } - + /** * This method determines what should be done with a given file and adds * it via {@link GroupTest::addTestFile()} if necessary. * - * This method should be overriden to provide custom matching criteria, + * This method should be overriden to provide custom matching criteria, * such as pattern matching, recursive matching, etc. For an example, see * {@link SimplePatternCollector::_handle()}. * @@ -85,8 +84,8 @@ class SimpleCollector { */ class SimplePatternCollector extends SimpleCollector { protected $_pattern; - - + + /** * * @param string $pattern Perl compatible regex to test name against @@ -96,8 +95,8 @@ class SimplePatternCollector extends SimpleCollector { function SimplePatternCollector($pattern = '/php$/i') { $this->_pattern = $pattern; } - - + + /** * Attempts to add files that match a given pattern. * @@ -111,5 +110,4 @@ class SimplePatternCollector extends SimpleCollector { parent::_handle($test, $filename); } } -} -?>
\ No newline at end of file +}
\ No newline at end of file diff --git a/tests/test_tools/simpletest/compatibility.php b/tests/test_tools/simpletest/compatibility.php index 92cf70d3..a181793e 100644 --- a/tests/test_tools/simpletest/compatibility.php +++ b/tests/test_tools/simpletest/compatibility.php @@ -181,4 +181,3 @@ return array(); } } -?> diff --git a/tests/test_tools/simpletest/cookies.php b/tests/test_tools/simpletest/cookies.php index 4a2b0d4e..eba8776e 100644 --- a/tests/test_tools/simpletest/cookies.php +++ b/tests/test_tools/simpletest/cookies.php @@ -11,7 +11,7 @@ */ require_once(dirname(__FILE__) . '/url.php'); /**#@-*/ - + /** * Cookie data holder. Cookie rules are full of pretty * arbitary stuff. I have used... @@ -27,7 +27,7 @@ protected $_path; protected $_expiry; protected $_is_secure; - + /** * Constructor. Sets the stored values. * @param string $name Cookie key. @@ -49,7 +49,7 @@ } $this->_is_secure = $is_secure; } - + /** * Sets the host. The cookie rules determine * that the first two parts are taken for @@ -67,7 +67,7 @@ } return false; } - + /** * Accessor for the truncated host to which this * cookie applies. @@ -77,7 +77,7 @@ function getHost() { return $this->_host; } - + /** * Test for a cookie being valid for a host name. * @param string $host Host to test against. @@ -87,7 +87,7 @@ function isValidHost($host) { return ($this->_truncateHost($host) === $this->getHost()); } - + /** * Extracts just the domain part that determines a * cookie's host validity. @@ -104,7 +104,7 @@ } return false; } - + /** * Accessor for name. * @return string Cookie key. @@ -113,7 +113,7 @@ function getName() { return $this->_name; } - + /** * Accessor for value. A deleted cookie will * have an empty string for this. @@ -123,7 +123,7 @@ function getValue() { return $this->_value; } - + /** * Accessor for path. * @return string Valid cookie path. @@ -132,7 +132,7 @@ function getPath() { return $this->_path; } - + /** * Tests a path to see if the cookie applies * there. The test path must be longer or @@ -147,7 +147,7 @@ $this->getPath(), strlen($this->getPath())) == 0); } - + /** * Accessor for expiry. * @return string Expiry string. @@ -159,7 +159,7 @@ } return gmdate("D, d M Y H:i:s", $this->_expiry) . " GMT"; } - + /** * Test to see if cookie is expired against * the cookie format time or timestamp. @@ -180,7 +180,7 @@ } return ($this->_expiry < $now); } - + /** * Ages the cookie by the specified number of * seconds. @@ -192,7 +192,7 @@ $this->_expiry -= $interval; } } - + /** * Accessor for the secure flag. * @return boolean True if cookie needs SSL. @@ -201,7 +201,7 @@ function isSecure() { return $this->_is_secure; } - + /** * Adds a trailing and leading slash to the path * if missing. @@ -218,7 +218,7 @@ return $path; } } - + /** * Repository for cookies. This stuff is a * tiny bit browser dependent. @@ -227,7 +227,7 @@ */ class SimpleCookieJar { protected $_cookies; - + /** * Constructor. Jar starts empty. * @access public @@ -235,7 +235,7 @@ function SimpleCookieJar() { $this->_cookies = array(); } - + /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. @@ -258,7 +258,7 @@ } $this->_cookies = $surviving_cookies; } - + /** * Ages all cookies in the cookie jar. * @param integer $interval The old session is moved @@ -272,7 +272,7 @@ $this->_cookies[$i]->agePrematurely($interval); } } - + /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. @@ -290,7 +290,7 @@ } $this->_cookies[$this->_findFirstMatch($cookie)] = $cookie; } - + /** * Finds a matching cookie to write over or the * first empty slot if none. @@ -311,7 +311,7 @@ } return count($this->_cookies); } - + /** * Reads the most specific cookie value from the * browser cookies. Looks for the longest path that @@ -335,7 +335,7 @@ } return (isset($value) ? $value : false); } - + /** * Tests cookie for matching against search * criteria. @@ -359,7 +359,7 @@ } return true; } - + /** * Uses a URL to sift relevant cookies by host and * path. Results are list of strings of form "name=value". @@ -376,5 +376,4 @@ } return $pairs; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/detached.php b/tests/test_tools/simpletest/detached.php index 1f3638bb..06665781 100644 --- a/tests/test_tools/simpletest/detached.php +++ b/tests/test_tools/simpletest/detached.php @@ -92,5 +92,4 @@ function &_createParser($reporter) { return new SimpleTestXmlParser($reporter); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/dumper.php b/tests/test_tools/simpletest/dumper.php index a2ea30b0..9c3f745a 100644 --- a/tests/test_tools/simpletest/dumper.php +++ b/tests/test_tools/simpletest/dumper.php @@ -398,5 +398,4 @@ } return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/encoding.php b/tests/test_tools/simpletest/encoding.php index 0dc9fbfa..ca2083a3 100644 --- a/tests/test_tools/simpletest/encoding.php +++ b/tests/test_tools/simpletest/encoding.php @@ -5,7 +5,7 @@ * @subpackage WebTester * @version $Id: encoding.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include other SimpleTest class files */ @@ -20,7 +20,7 @@ class SimpleEncodedPair { protected $_key; protected $_value; - + /** * Stashes the data for rendering later. * @param string $key Form element name. @@ -30,7 +30,7 @@ $this->_key = $key; $this->_value = $value; } - + /** * The pair as a single string. * @return string Encoded pair. @@ -39,7 +39,7 @@ function asRequest() { return $this->_key . '=' . urlencode($this->_value); } - + /** * The MIME part as a string. * @return string MIME part encoding. @@ -51,7 +51,7 @@ $part .= "\r\n" . $this->_value; return $part; } - + /** * Is this the value we are looking for? * @param string $key Identifier. @@ -61,7 +61,7 @@ function isKey($key) { return $key == $this->_key; } - + /** * Is this the value we are looking for? * @return string Identifier. @@ -70,7 +70,7 @@ function getKey() { return $this->_key; } - + /** * Is this the value we are looking for? * @return string Content. @@ -90,7 +90,7 @@ protected $_key; protected $_content; protected $_filename; - + /** * Stashes the data for rendering later. * @param string $key Key to add value to. @@ -102,7 +102,7 @@ $this->_content = $content; $this->_filename = $filename; } - + /** * The pair as a single string. * @return string Encoded pair. @@ -111,7 +111,7 @@ function asRequest() { return ''; } - + /** * The MIME part as a string. * @return string MIME part encoding. @@ -125,7 +125,7 @@ $part .= "\r\n\r\n" . $this->_content; return $part; } - + /** * Attempts to figure out the MIME type from the * file extension and the content. @@ -138,7 +138,7 @@ } return 'application/octet-stream'; } - + /** * Tests each character is in the range 0-127. * @param string $ascii String to test. @@ -152,7 +152,7 @@ } return true; } - + /** * Is this the value we are looking for? * @param string $key Identifier. @@ -162,7 +162,7 @@ function isKey($key) { return $key == $this->_key; } - + /** * Is this the value we are looking for? * @return string Identifier. @@ -171,7 +171,7 @@ function getKey() { return $this->_key; } - + /** * Is this the value we are looking for? * @return string Content. @@ -190,7 +190,7 @@ */ class SimpleEncoding { protected $_request; - + /** * Starts empty. * @param array $query Hash of parameters. @@ -205,7 +205,7 @@ $this->clear(); $this->merge($query); } - + /** * Empties the request of parameters. * @access public @@ -213,7 +213,7 @@ function clear() { $this->_request = array(); } - + /** * Adds a parameter to the query. * @param string $key Key to add value to. @@ -232,7 +232,7 @@ $this->_addPair($key, $value); } } - + /** * Adds a new value into the request. * @param string $key Key to add value to. @@ -242,7 +242,7 @@ function _addPair($key, $value) { $this->_request[] = new SimpleEncodedPair($key, $value); } - + /** * Adds a MIME part to the query. Does nothing for a * form encoded packet. @@ -254,7 +254,7 @@ function attach($key, $content, $filename) { $this->_request[] = new SimpleAttachment($key, $content, $filename); } - + /** * Adds a set of parameters to this query. * @param array/SimpleQueryString $query Multiple values are @@ -270,7 +270,7 @@ } } } - + /** * Accessor for single value. * @return string/array False if missing, string @@ -293,7 +293,7 @@ return $values; } } - + /** * Accessor for listing of pairs. * @return array All pair objects. @@ -302,7 +302,7 @@ function getAll() { return $this->_request; } - + /** * Renders the query string as a URL encoded * request part. @@ -319,7 +319,7 @@ return implode('&', $statements); } } - + /** * Bundle of GET parameters. Can include * repeated parameters. @@ -327,7 +327,7 @@ * @subpackage WebTester */ class SimpleGetEncoding extends SimpleEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -338,7 +338,7 @@ function SimpleGetEncoding($query = false) { $this->SimpleEncoding($query); } - + /** * HTTP request method. * @return string Always GET. @@ -347,7 +347,7 @@ function getMethod() { return 'GET'; } - + /** * Writes no extra headers. * @param SimpleSocket $socket Socket to write to. @@ -355,7 +355,7 @@ */ function writeHeadersTo($socket) { } - + /** * No data is sent to the socket as the data is encoded into * the URL. @@ -364,7 +364,7 @@ */ function writeTo($socket) { } - + /** * Renders the query string as a URL encoded * request part for attaching to a URL. @@ -375,14 +375,14 @@ return $this->_encode(); } } - + /** * Bundle of URL parameters for a HEAD request. * @package SimpleTest * @subpackage WebTester */ class SimpleHeadEncoding extends SimpleGetEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -393,7 +393,7 @@ function SimpleHeadEncoding($query = false) { $this->SimpleGetEncoding($query); } - + /** * HTTP request method. * @return string Always HEAD. @@ -403,7 +403,7 @@ return 'HEAD'; } } - + /** * Bundle of POST parameters. Can include * repeated parameters. @@ -411,7 +411,7 @@ * @subpackage WebTester */ class SimplePostEncoding extends SimpleEncoding { - + /** * Starts empty. * @param array $query Hash of parameters. @@ -422,7 +422,7 @@ function SimplePostEncoding($query = false) { $this->SimpleEncoding($query); } - + /** * HTTP request method. * @return string Always POST. @@ -431,7 +431,7 @@ function getMethod() { return 'POST'; } - + /** * Dispatches the form headers down the socket. * @param SimpleSocket $socket Socket to write to. @@ -441,7 +441,7 @@ $socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n"); $socket->write("Content-Type: application/x-www-form-urlencoded\r\n"); } - + /** * Dispatches the form data down the socket. * @param SimpleSocket $socket Socket to write to. @@ -450,7 +450,7 @@ function writeTo($socket) { $socket->write($this->_encode()); } - + /** * Renders the query string as a URL encoded * request part for attaching to a URL. @@ -461,7 +461,7 @@ return ''; } } - + /** * Bundle of POST parameters in the multipart * format. Can include file uploads. @@ -470,7 +470,7 @@ */ class SimpleMultipartEncoding extends SimplePostEncoding { protected $_boundary; - + /** * Starts empty. * @param array $query Hash of parameters. @@ -482,7 +482,7 @@ $this->SimplePostEncoding($query); $this->_boundary = ($boundary === false ? uniqid('st') : $boundary); } - + /** * Dispatches the form headers down the socket. * @param SimpleSocket $socket Socket to write to. @@ -492,7 +492,7 @@ $socket->write("Content-Length: " . (integer)strlen($this->_encode()) . "\r\n"); $socket->write("Content-Type: multipart/form-data, boundary=" . $this->_boundary . "\r\n"); } - + /** * Dispatches the form data down the socket. * @param SimpleSocket $socket Socket to write to. @@ -501,7 +501,7 @@ function writeTo($socket) { $socket->write($this->_encode()); } - + /** * Renders the query string as a URL encoded * request part. @@ -517,5 +517,4 @@ $stream .= "--" . $this->_boundary . "--\r\n"; return $stream; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/errors.php b/tests/test_tools/simpletest/errors.php index a756bd7c..c10d68a5 100644 --- a/tests/test_tools/simpletest/errors.php +++ b/tests/test_tools/simpletest/errors.php @@ -178,5 +178,4 @@ $queue->add($severity, $message, $filename, $line, $super_globals); set_error_handler('simpleTestErrorHandler'); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/exceptions.php b/tests/test_tools/simpletest/exceptions.php index 63558ad1..30d35386 100644 --- a/tests/test_tools/simpletest/exceptions.php +++ b/tests/test_tools/simpletest/exceptions.php @@ -42,5 +42,4 @@ $test_case->exception($exception); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/expectation.php b/tests/test_tools/simpletest/expectation.php index 8513aff4..a660fa9c 100644 --- a/tests/test_tools/simpletest/expectation.php +++ b/tests/test_tools/simpletest/expectation.php @@ -717,4 +717,3 @@ "] should contain method [$method]"; } } -?> diff --git a/tests/test_tools/simpletest/form.php b/tests/test_tools/simpletest/form.php index 0e6aea14..fba26bf6 100644 --- a/tests/test_tools/simpletest/form.php +++ b/tests/test_tools/simpletest/form.php @@ -5,7 +5,7 @@ * @subpackage WebTester * @version $Id: form.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include SimpleTest files */ @@ -13,7 +13,7 @@ require_once(dirname(__FILE__) . '/encoding.php'); require_once(dirname(__FILE__) . '/selector.php'); /**#@-*/ - + /** * Form tag class to hold widget values. * @package SimpleTest @@ -30,7 +30,7 @@ protected $_widgets; protected $_radios; protected $_checkboxes; - + /** * Starts with no held controls/widgets. * @param SimpleTag $tag Form tag to read. @@ -48,7 +48,7 @@ $this->_radios = array(); $this->_checkboxes = array(); } - + /** * Creates the request packet to be sent by the form. * @param SimpleTag $tag Form tag to read. @@ -64,7 +64,7 @@ } return 'SimpleGetEncoding'; } - + /** * Sets the frame target within a frameset. * @param string $frame Name of frame. @@ -73,7 +73,7 @@ function setDefaultTarget($frame) { $this->_default_target = $frame; } - + /** * Accessor for method of form submission. * @return string Either get or post. @@ -82,7 +82,7 @@ function getMethod() { return ($this->_method ? strtolower($this->_method) : 'get'); } - + /** * Combined action attribute with current location * to get an absolute form target. @@ -97,7 +97,7 @@ $url = new SimpleUrl($action); return $url->makeAbsolute($base); } - + /** * Absolute URL of the target. * @return SimpleUrl URL target. @@ -110,7 +110,7 @@ } return $url; } - + /** * Creates the encoding for the current values in the * form. @@ -125,7 +125,7 @@ } return $encoding; } - + /** * ID field of form for unique identification. * @return string Unique tag ID. @@ -134,7 +134,7 @@ function getId() { return $this->_id; } - + /** * Adds a tag contents to the form. * @param SimpleWidget $tag Input tag to add. @@ -149,7 +149,7 @@ $this->_setWidget($tag); } } - + /** * Sets the widget into the form, grouping radio * buttons if any. @@ -165,7 +165,7 @@ $this->_widgets[] = $tag; } } - + /** * Adds a radio button, building a group if necessary. * @param SimpleRadioButtonTag $tag Incoming form control. @@ -178,7 +178,7 @@ } $this->_widgets[$this->_radios[$tag->getName()]]->addWidget($tag); } - + /** * Adds a checkbox, making it a group on a repeated name. * @param SimpleCheckboxTag $tag Incoming form control. @@ -198,7 +198,7 @@ $this->_widgets[$index]->addWidget($tag); } } - + /** * Extracts current value from form. * @param SimpleSelector $selector Criteria to apply. @@ -219,7 +219,7 @@ } return null; } - + /** * Sets a widget value within the form. * @param SimpleSelector $selector Criteria to apply. @@ -240,7 +240,7 @@ } return $success; } - + /** * Used by the page object to set widgets labels to * external label tags. @@ -257,7 +257,7 @@ } } } - + /** * Test to see if a form has a submit button. * @param SimpleSelector $selector Criteria to apply. @@ -272,7 +272,7 @@ } return false; } - + /** * Test to see if a form has an image control. * @param SimpleSelector $selector Criteria to apply. @@ -287,7 +287,7 @@ } return false; } - + /** * Gets the submit values for a selected button. * @param SimpleSelector $selector Criteria to apply. @@ -306,12 +306,12 @@ if ($additional) { $encoding->merge($additional); } - return $encoding; + return $encoding; } } return false; } - + /** * Gets the submit values for an image. * @param SimpleSelector $selector Criteria to apply. @@ -332,12 +332,12 @@ if ($additional) { $encoding->merge($additional); } - return $encoding; + return $encoding; } } return false; } - + /** * Simply submits the form without the submit button * value. Used when there is only one button or it @@ -349,4 +349,3 @@ return $this->_encode(); } } -?> diff --git a/tests/test_tools/simpletest/frames.php b/tests/test_tools/simpletest/frames.php index 60ced141..86e03157 100644 --- a/tests/test_tools/simpletest/frames.php +++ b/tests/test_tools/simpletest/frames.php @@ -584,5 +584,4 @@ } return null; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/http.php b/tests/test_tools/simpletest/http.php index 9344a5b9..78c91b7e 100644 --- a/tests/test_tools/simpletest/http.php +++ b/tests/test_tools/simpletest/http.php @@ -13,7 +13,7 @@ require_once(dirname(__FILE__) . '/cookies.php'); require_once(dirname(__FILE__) . '/url.php'); /**#@-*/ - + /** * Creates HTTP headers for the end point of * a HTTP request. @@ -22,7 +22,7 @@ */ class SimpleRoute { protected $_url; - + /** * Sets the target URL. * @param SimpleUrl $url URL as object. @@ -31,7 +31,7 @@ function SimpleRoute($url) { $this->_url = $url; } - + /** * Resource name. * @return SimpleUrl Current url. @@ -40,7 +40,7 @@ function getUrl() { return $this->_url; } - + /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. @@ -51,7 +51,7 @@ return $method . ' ' . $this->_url->getPath() . $this->_url->getEncodedRequest() . ' HTTP/1.0'; } - + /** * Creates the host part of the request. * @return string Host line content. @@ -64,7 +64,7 @@ } return $line; } - + /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. @@ -86,7 +86,7 @@ } return $socket; } - + /** * Factory for socket. * @param string $scheme Protocol to use. @@ -105,7 +105,7 @@ return $socket; } } - + /** * Creates HTTP headers for the end point of * a HTTP request via a proxy server. @@ -116,7 +116,7 @@ protected $_proxy; protected $_username; protected $_password; - + /** * Stashes the proxy address. * @param SimpleUrl $url URL as object. @@ -131,7 +131,7 @@ $this->_username = $username; $this->_password = $password; } - + /** * Creates the first line which is the actual request. * @param string $method HTTP request method, usually GET. @@ -146,7 +146,7 @@ return $method . ' ' . $scheme . '://' . $url->getHost() . $port . $url->getPath() . $url->getEncodedRequest() . ' HTTP/1.0'; } - + /** * Creates the host part of the request. * @param SimpleUrl $url URL as object. @@ -158,7 +158,7 @@ $port = $this->_proxy->getPort() ? $this->_proxy->getPort() : 8080; return "$host:$port"; } - + /** * Opens a socket to the route. * @param string $method HTTP request method, usually GET. @@ -198,7 +198,7 @@ protected $_encoding; protected $_headers; protected $_cookies; - + /** * Builds the socket request from the different pieces. * These include proxy information, URL, cookies, headers, @@ -214,7 +214,7 @@ $this->_headers = array(); $this->_cookies = array(); } - + /** * Dispatches the content to the route's socket. * @param integer $timeout Connection timeout. @@ -231,7 +231,7 @@ $response = $this->_createResponse($socket); return $response; } - + /** * Sends the headers. * @param SimpleSocket $socket Open socket. @@ -251,7 +251,7 @@ $socket->write("\r\n"); $encoding->writeTo($socket); } - + /** * Adds a header line to the request. * @param string $header_line Text of full header line. @@ -260,7 +260,7 @@ function addHeaderLine($header_line) { $this->_headers[] = $header_line; } - + /** * Reads all the relevant cookies from the * cookie jar. @@ -271,7 +271,7 @@ function readCookiesFromJar($jar, $url) { $this->_cookies = $jar->selectAsPairs($url); } - + /** * Wraps the socket in a response parser. * @param SimpleSocket $socket Responding socket. @@ -286,7 +286,7 @@ return $response; } } - + /** * Collection of header lines in the response. * @package SimpleTest @@ -301,7 +301,7 @@ protected $_cookies; protected $_authentication; protected $_realm; - + /** * Parses the incoming header block. * @param string $headers Header block. @@ -320,7 +320,7 @@ $this->_parseHeaderLine($header_line); } } - + /** * Accessor for parsed HTTP protocol version. * @return integer HTTP error code. @@ -329,7 +329,7 @@ function getHttpVersion() { return $this->_http_version; } - + /** * Accessor for raw header block. * @return string All headers as raw string. @@ -338,7 +338,7 @@ function getRaw() { return $this->_raw_headers; } - + /** * Accessor for parsed HTTP error code. * @return integer HTTP error code. @@ -347,7 +347,7 @@ function getResponseCode() { return (integer)$this->_response_code; } - + /** * Returns the redirected URL or false if * no redirection. @@ -357,7 +357,7 @@ function getLocation() { return $this->_location; } - + /** * Test to see if the response is a valid redirect. * @return boolean True if valid redirect. @@ -367,7 +367,7 @@ return in_array($this->_response_code, array(301, 302, 303, 307)) && (boolean)$this->getLocation(); } - + /** * Test to see if the response is an authentication * challenge. @@ -379,7 +379,7 @@ (boolean)$this->_authentication && (boolean)$this->_realm; } - + /** * Accessor for MIME type header information. * @return string MIME type. @@ -388,7 +388,7 @@ function getMimeType() { return $this->_mime_type; } - + /** * Accessor for authentication type. * @return string Type. @@ -397,7 +397,7 @@ function getAuthentication() { return $this->_authentication; } - + /** * Accessor for security realm. * @return string Realm. @@ -406,7 +406,7 @@ function getRealm() { return $this->_realm; } - + /** * Writes new cookies to the cookie jar. * @param SimpleCookieJar $jar Jar to write to. @@ -449,7 +449,7 @@ $this->_realm = trim($matches[2]); } } - + /** * Parse the Set-cookie content. * @param string $cookie_line Text after "Set-cookie:" @@ -472,7 +472,7 @@ isset($cookie["expires"]) ? $cookie["expires"] : false); } } - + /** * Basic HTTP response. * @package SimpleTest @@ -484,7 +484,7 @@ protected $_sent; protected $_content; protected $_headers; - + /** * Constructor. Reads and parses the incoming * content and headers. @@ -507,7 +507,7 @@ } $this->_parse($raw); } - + /** * Splits up the headers and the rest of the content. * @param string $raw Content to parse. @@ -525,7 +525,7 @@ $this->_headers = new SimpleHttpHeaders($headers); } } - + /** * Original request method. * @return string GET, POST or HEAD. @@ -534,7 +534,7 @@ function getMethod() { return $this->_encoding->getMethod(); } - + /** * Resource name. * @return SimpleUrl Current url. @@ -543,7 +543,7 @@ function getUrl() { return $this->_url; } - + /** * Original request data. * @return mixed Sent content. @@ -552,7 +552,7 @@ function getRequestData() { return $this->_encoding; } - + /** * Raw request that was sent down the wire. * @return string Bytes actually sent. @@ -561,7 +561,7 @@ function getSent() { return $this->_sent; } - + /** * Accessor for the content after the last * header line. @@ -571,7 +571,7 @@ function getContent() { return $this->_content; } - + /** * Accessor for header block. The response is the * combination of this and the content. @@ -581,7 +581,7 @@ function getHeaders() { return $this->_headers; } - + /** * Accessor for any new cookies. * @return array List of new cookies. @@ -590,7 +590,7 @@ function getNewCookies() { return $this->_headers->getNewCookies(); } - + /** * Reads the whole of the socket output into a * single string. @@ -606,7 +606,7 @@ } return $all; } - + /** * Test to see if the packet from the socket is the * last one. @@ -620,5 +620,4 @@ } return ! $packet; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/invoker.php b/tests/test_tools/simpletest/invoker.php index d5bf4996..dfe9263c 100644 --- a/tests/test_tools/simpletest/invoker.php +++ b/tests/test_tools/simpletest/invoker.php @@ -136,4 +136,3 @@ $this->_invoker->after($method); } } -?> diff --git a/tests/test_tools/simpletest/mock_objects.php b/tests/test_tools/simpletest/mock_objects.php index 1636600e..b63d1760 100644 --- a/tests/test_tools/simpletest/mock_objects.php +++ b/tests/test_tools/simpletest/mock_objects.php @@ -1269,5 +1269,4 @@ } return $code; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/options.php b/tests/test_tools/simpletest/options.php index da4d8b2f..23008ff9 100644 --- a/tests/test_tools/simpletest/options.php +++ b/tests/test_tools/simpletest/options.php @@ -363,4 +363,3 @@ return array(); } } -?> diff --git a/tests/test_tools/simpletest/page.php b/tests/test_tools/simpletest/page.php index eeae0cc9..7d0ac7b8 100644 --- a/tests/test_tools/simpletest/page.php +++ b/tests/test_tools/simpletest/page.php @@ -128,7 +128,7 @@ function SimplePageBuilder() { $this->SimpleSaxListener(); } - + /** * Frees up any references so as to allow the PHP garbage * collection from unset() to work. @@ -177,7 +177,7 @@ $parser = new SimpleHtmlSaxParser($listener); return $parser; } - + /** * Start of element event. Opens a new tag. * @param string $name Element name. @@ -972,4 +972,3 @@ return null; } } -?> diff --git a/tests/test_tools/simpletest/parser.php b/tests/test_tools/simpletest/parser.php index d6c10579..94fd40d0 100644 --- a/tests/test_tools/simpletest/parser.php +++ b/tests/test_tools/simpletest/parser.php @@ -769,5 +769,4 @@ */ function addContent($text) { } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reflection_php4.php b/tests/test_tools/simpletest/reflection_php4.php index 4af685ec..df9c76cc 100644 --- a/tests/test_tools/simpletest/reflection_php4.php +++ b/tests/test_tools/simpletest/reflection_php4.php @@ -111,5 +111,4 @@ function getSignature($method) { return "function $method()"; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reflection_php5.php b/tests/test_tools/simpletest/reflection_php5.php index 58a30856..6d2ad360 100644 --- a/tests/test_tools/simpletest/reflection_php5.php +++ b/tests/test_tools/simpletest/reflection_php5.php @@ -124,7 +124,7 @@ } return array_unique($methods); } - + /** * Checks to see if the method signature has to be tightly * specified. @@ -207,7 +207,7 @@ } return "function $name()"; } - + /** * For a signature specified in an interface, full * details must be replicated to be a valid implementation. @@ -271,5 +271,4 @@ } return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/remote.php b/tests/test_tools/simpletest/remote.php index 7e6898cb..1868733d 100644 --- a/tests/test_tools/simpletest/remote.php +++ b/tests/test_tools/simpletest/remote.php @@ -23,7 +23,7 @@ protected $_url; protected $_dry_url; protected $_size; - + /** * Sets the location of the remote test. * @param string $url Test location. @@ -35,7 +35,7 @@ $this->_dry_url = $dry_url ? $dry_url : $url; $this->_size = false; } - + /** * Accessor for the test name for subclasses. * @return string Name of the test. @@ -67,7 +67,7 @@ } return true; } - + /** * Creates a new web browser object for fetching * the XML report. @@ -77,7 +77,7 @@ function &_createBrowser() { return new SimpleBrowser(); } - + /** * Creates the XML parser. * @param SimpleReporter $reporter Target of test results. @@ -87,7 +87,7 @@ function &_createParser($reporter) { return new SimpleTestXmlParser($reporter); } - + /** * Accessor for the number of subtests. * @return integer Number of test cases. @@ -111,5 +111,4 @@ } return $this->_size; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/reporter.php b/tests/test_tools/simpletest/reporter.php index c8c1639d..a6b5a85a 100644 --- a/tests/test_tools/simpletest/reporter.php +++ b/tests/test_tools/simpletest/reporter.php @@ -363,5 +363,4 @@ $this->_within_test_case = false; } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/runner.php b/tests/test_tools/simpletest/runner.php index 57939f7a..d7303895 100644 --- a/tests/test_tools/simpletest/runner.php +++ b/tests/test_tools/simpletest/runner.php @@ -5,7 +5,7 @@ * @subpackage UnitTester * @version $Id: runner.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * Includes SimpleTest files and defined the root constant * for dependent libraries. @@ -19,7 +19,7 @@ define('SIMPLE_TEST', dirname(__FILE__) . '/'); } /**#@-*/ - + /** * This is called by the class runner to run a * single test method. Will also run the setUp() @@ -29,7 +29,7 @@ */ class SimpleInvoker { protected $_test_case; - + /** * Stashes the test case for later. * @param SimpleTestCase $test_case Test case to run. @@ -37,7 +37,7 @@ function SimpleInvoker($test_case) { $this->_test_case = $test_case; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -46,7 +46,7 @@ function getTestCase() { return $this->_test_case; } - + /** * Invokes a test method and buffered with setUp() * and tearDown() calls. @@ -59,7 +59,7 @@ $this->_test_case->tearDown(); } } - + /** * Do nothing decorator. Just passes the invocation * straight through. @@ -68,7 +68,7 @@ */ class SimpleInvokerDecorator { protected $_invoker; - + /** * Stores the invoker to wrap. * @param SimpleInvoker $invoker Test method runner. @@ -76,7 +76,7 @@ function SimpleInvokerDecorator($invoker) { $this->_invoker = $invoker; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -85,7 +85,7 @@ function getTestCase() { return $this->_invoker->getTestCase(); } - + /** * Invokes a test method and buffered with setUp() * and tearDown() calls. @@ -103,7 +103,7 @@ * @subpackage UnitTester */ class SimpleErrorTrappingInvoker extends SimpleInvokerDecorator { - + /** /** * Stores the invoker to wrap. @@ -112,7 +112,7 @@ function SimpleErrorTrappingInvoker($invoker) { $this->SimpleInvokerDecorator($invoker); } - + /** * Invokes a test method and dispatches any * untrapped errors. Called back from @@ -142,7 +142,7 @@ class SimpleRunner { protected $_test_case; protected $_scorer; - + /** * Takes in the test case and reporter to mediate between. * @param SimpleTestCase $test_case Test case to run. @@ -152,7 +152,7 @@ $this->_test_case = $test_case; $this->_scorer = $scorer; } - + /** * Accessor for test case being run. * @return SimpleTestCase Test case. @@ -161,7 +161,7 @@ function getTestCase() { return $this->_test_case; } - + /** * Runs the test methods in the test case. * @param SimpleTest $test_case Test case to run test on. @@ -185,7 +185,7 @@ $this->_scorer->paintMethodEnd($method); } } - + /** * Tests to see if the method is the constructor and * so should be ignored. @@ -198,7 +198,7 @@ $this->_test_case, strtolower($method)); } - + /** * Tests to see if the method is a test that should * be run. Currently any method that starts with 'test' @@ -219,7 +219,7 @@ function paintMethodStart($test_name) { $this->_scorer->paintMethodStart($test_name); } - + /** * Paints the end of a test method. * @param string $test_name Name of test or other label. @@ -228,7 +228,7 @@ function paintMethodEnd($test_name) { $this->_scorer->paintMethodEnd($test_name); } - + /** * Chains to the wrapped reporter. * @param string $message Message is ignored. @@ -237,7 +237,7 @@ function paintPass($message) { $this->_scorer->paintPass($message); } - + /** * Chains to the wrapped reporter. * @param string $message Message is ignored. @@ -246,7 +246,7 @@ function paintFail($message) { $this->_scorer->paintFail($message); } - + /** * Chains to the wrapped reporter. * @param string $message Text of error formatted by @@ -256,7 +256,7 @@ function paintError($message) { $this->_scorer->paintError($message); } - + /** * Chains to the wrapped reporter. * @param Exception $exception Object thrown. @@ -265,7 +265,7 @@ function paintException($exception) { $this->_scorer->paintException($exception); } - + /** * Chains to the wrapped reporter. * @param string $message Text to display. @@ -274,7 +274,7 @@ function paintMessage($message) { $this->_scorer->paintMessage($message); } - + /** * Chains to the wrapped reporter. * @param string $message Text to display. @@ -283,7 +283,7 @@ function paintFormattedMessage($message) { $this->_scorer->paintFormattedMessage($message); } - + /** * Chains to the wrapped reporter. * @param string $type Event type as text. @@ -297,4 +297,3 @@ $this->_scorer->paintSignal($type, $payload); } } -?> diff --git a/tests/test_tools/simpletest/scorer.php b/tests/test_tools/simpletest/scorer.php index 2c81c954..48b7162b 100644 --- a/tests/test_tools/simpletest/scorer.php +++ b/tests/test_tools/simpletest/scorer.php @@ -773,5 +773,4 @@ $this->_reporters[$i]->paintSignal($type, $payload); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/selector.php b/tests/test_tools/simpletest/selector.php index 901815ad..6af21ff6 100644 --- a/tests/test_tools/simpletest/selector.php +++ b/tests/test_tools/simpletest/selector.php @@ -129,5 +129,4 @@ } return ($widget->getName() == $this->_label); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/shell_tester.php b/tests/test_tools/simpletest/shell_tester.php index 5719e9d3..5ac6013d 100644 --- a/tests/test_tools/simpletest/shell_tester.php +++ b/tests/test_tools/simpletest/shell_tester.php @@ -127,7 +127,7 @@ $shell = $this->_getShell(); return $shell->getOutputAsList(); } - + /** * Will trigger a pass if the two parameters have * the same value only. Otherwise a fail. This @@ -144,7 +144,7 @@ $second, $message); } - + /** * Will trigger a pass if the two parameters have * a different value. Otherwise a fail. This @@ -302,5 +302,4 @@ $shell = new SimpleShell(); return $shell; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/simple_test.php b/tests/test_tools/simpletest/simple_test.php index 3bb1d40e..cc39a08b 100644 --- a/tests/test_tools/simpletest/simple_test.php +++ b/tests/test_tools/simpletest/simple_test.php @@ -550,4 +550,3 @@ return 0; } } -?> diff --git a/tests/test_tools/simpletest/simpletest.php b/tests/test_tools/simpletest/simpletest.php index f859ac0f..df1536ac 100644 --- a/tests/test_tools/simpletest/simpletest.php +++ b/tests/test_tools/simpletest/simpletest.php @@ -278,5 +278,4 @@ function getDefaultProxyPassword() { return Simpletest::getDefaultProxyPassword(); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/socket.php b/tests/test_tools/simpletest/socket.php index 7b47aa9c..cfeed48a 100644 --- a/tests/test_tools/simpletest/socket.php +++ b/tests/test_tools/simpletest/socket.php @@ -212,5 +212,4 @@ function _openSocket($host, $port, $error_number, $error, $timeout) { return parent::_openSocket("tls://$host", $port, $error_number, $error, $timeout); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/tag.php b/tests/test_tools/simpletest/tag.php index 5d8de890..46fb740a 100644 --- a/tests/test_tools/simpletest/tag.php +++ b/tests/test_tools/simpletest/tag.php @@ -5,14 +5,14 @@ * @subpackage WebTester * @version $Id: tag.php 1398 2006-09-08 19:31:03Z xue $ */ - + /**#@+ * include SimpleTest files */ require_once(dirname(__FILE__) . '/parser.php'); require_once(dirname(__FILE__) . '/encoding.php'); /**#@-*/ - + /** * HTML or XML tag. * @package SimpleTest @@ -22,7 +22,7 @@ protected $_name; protected $_attributes; protected $_content; - + /** * Starts with a named tag with attributes only. * @param string $name Tag name. @@ -36,7 +36,7 @@ $this->_attributes = $attributes; $this->_content = ''; } - + /** * Check to see if the tag can have both start and * end tags with content in between. @@ -46,7 +46,7 @@ function expectEndTag() { return true; } - + /** * The current tag should not swallow all content for * itself as it's searchable page content. Private @@ -68,7 +68,7 @@ function addContent($content) { $this->_content .= (string)$content; } - + /** * Adds an enclosed tag to the content. * @param SimpleTag $tag New tag. @@ -76,7 +76,7 @@ */ function addTag($tag) { } - + /** * Accessor for tag name. * @return string Name of tag. @@ -85,7 +85,7 @@ function getTagName() { return $this->_name; } - + /** * List of legal child elements. * @return array List of element names. @@ -94,7 +94,7 @@ function getChildElements() { return array(); } - + /** * Accessor for an attribute. * @param string $label Attribute name. @@ -108,7 +108,7 @@ } return (string)$this->_attributes[$label]; } - + /** * Sets an attribute. * @param string $label Attribute name. @@ -118,7 +118,7 @@ function _setAttribute($label, $value) { $this->_attributes[strtolower($label)] = $value; } - + /** * Accessor for the whole content so far. * @return string Content as big raw string. @@ -127,7 +127,7 @@ function getContent() { return $this->_content; } - + /** * Accessor for content reduced to visible text. Acts * like a text mode browser, normalising space and @@ -138,7 +138,7 @@ function getText() { return SimpleHtmlSaxParser::normalise($this->_content); } - + /** * Test to see if id attribute matches. * @param string $id ID to test against. @@ -149,14 +149,14 @@ return ($this->getAttribute('id') == $id); } } - + /** * Page title. * @package SimpleTest * @subpackage WebTester */ class SimpleTitleTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -166,14 +166,14 @@ $this->SimpleTag('title', $attributes); } } - + /** * Link. * @package SimpleTest * @subpackage WebTester */ class SimpleAnchorTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -182,7 +182,7 @@ function SimpleAnchorTag($attributes) { $this->SimpleTag('a', $attributes); } - + /** * Accessor for URL as string. * @return string Coerced as string. @@ -196,7 +196,7 @@ return $url; } } - + /** * Form element. * @package SimpleTest @@ -206,7 +206,7 @@ protected $_value; protected $_label; protected $_is_set; - + /** * Starts with a named tag with attributes only. * @param string $name Tag name. @@ -219,7 +219,7 @@ $this->_label = false; $this->_is_set = false; } - + /** * Accessor for name submitted as the key in * GET/POST variables hash. @@ -229,7 +229,7 @@ function getName() { return $this->getAttribute('name'); } - + /** * Accessor for default value parsed with the tag. * @return string Parsed value. @@ -238,7 +238,7 @@ function getDefault() { return $this->getAttribute('value'); } - + /** * Accessor for currently set value or default if * none. @@ -252,7 +252,7 @@ } return $this->_value; } - + /** * Sets the current form element value. * @param string $value New value. @@ -264,7 +264,7 @@ $this->_is_set = true; return true; } - + /** * Resets the form element value back to the * default. @@ -273,7 +273,7 @@ function resetValue() { $this->_is_set = false; } - + /** * Allows setting of a label externally, say by a * label tag. @@ -283,7 +283,7 @@ function setLabel($label) { $this->_label = trim($label); } - + /** * Reads external or internal label. * @param string $label Label to test. @@ -293,7 +293,7 @@ function isLabel($label) { return $this->_label == trim($label); } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -305,14 +305,14 @@ } } } - + /** * Text, password and hidden field. * @package SimpleTest * @subpackage WebTester */ class SimpleTextTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -324,7 +324,7 @@ $this->_setAttribute('value', ''); } } - + /** * Tag contains no content. * @return boolean False. @@ -333,7 +333,7 @@ function expectEndTag() { return false; } - + /** * Sets the current form element value. Cannot * change the value of a hidden field. @@ -348,14 +348,14 @@ return parent::setValue($value); } } - + /** * Submit button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleSubmitTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -367,7 +367,7 @@ $this->_setAttribute('value', 'Submit'); } } - + /** * Tag contains no end element. * @return boolean False. @@ -376,7 +376,7 @@ function expectEndTag() { return false; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -386,7 +386,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -395,7 +395,7 @@ function getLabel() { return $this->getValue(); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -406,14 +406,14 @@ return trim($label) == trim($this->getLabel()); } } - + /** * Image button as input tag. * @package SimpleTest * @subpackage WebTester */ class SimpleImageSubmitTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -422,7 +422,7 @@ function SimpleImageSubmitTag($attributes) { $this->SimpleWidget('input', $attributes); } - + /** * Tag contains no end element. * @return boolean False. @@ -431,7 +431,7 @@ function expectEndTag() { return false; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -441,7 +441,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -453,7 +453,7 @@ } return $this->getAttribute('alt'); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -463,7 +463,7 @@ function isLabel($label) { return trim($label) == trim($this->getLabel()); } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -481,14 +481,14 @@ } } } - + /** * Submit button as button tag. * @package SimpleTest * @subpackage WebTester */ class SimpleButtonTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * Defaults are very browser dependent. @@ -498,7 +498,7 @@ function SimpleButtonTag($attributes) { $this->SimpleWidget('button', $attributes); } - + /** * Check to see if the tag can have both start and * end tags with content in between. @@ -508,7 +508,7 @@ function expectEndTag() { return true; } - + /** * Disables the setting of the button value. * @param string $value Ignored. @@ -518,7 +518,7 @@ function setValue($value) { return false; } - + /** * Value of browser visible text. * @return string Visible label. @@ -527,7 +527,7 @@ function getLabel() { return $this->getContent(); } - + /** * Test for a label match when searching. * @param string $label Label to test. @@ -538,14 +538,14 @@ return trim($label) == trim($this->getLabel()); } } - + /** * Content tag for text area. * @package SimpleTest * @subpackage WebTester */ class SimpleTextAreaTag extends SimpleWidget { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -554,7 +554,7 @@ function SimpleTextAreaTag($attributes) { $this->SimpleWidget('textarea', $attributes); } - + /** * Accessor for starting value. * @return string Parsed value. @@ -563,7 +563,7 @@ function getDefault() { return $this->_wrap(SimpleHtmlSaxParser::decodeHtml($this->getContent())); } - + /** * Applies word wrapping if needed. * @param string $value New value. @@ -573,7 +573,7 @@ function setValue($value) { return parent::setValue($this->_wrap($value)); } - + /** * Test to see if text should be wrapped. * @return boolean True if wrapping on. @@ -588,7 +588,7 @@ } return false; } - + /** * Performs the formatting that is peculiar to * this tag. There is strange behaviour in this @@ -613,7 +613,7 @@ } return $text; } - + /** * The content of textarea is not part of the page. * @return boolean True. @@ -623,14 +623,14 @@ return true; } } - + /** * File upload widget. * @package SimpleTest * @subpackage WebTester */ class SimpleUploadTag extends SimpleWidget { - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -639,7 +639,7 @@ function SimpleUploadTag($attributes) { $this->SimpleWidget('input', $attributes); } - + /** * Tag contains no content. * @return boolean False. @@ -648,7 +648,7 @@ function expectEndTag() { return false; } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -664,7 +664,7 @@ basename($this->getValue())); } } - + /** * Drop down widget. * @package SimpleTest @@ -673,7 +673,7 @@ class SimpleSelectionTag extends SimpleWidget { protected $_options; protected $_choice; - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -684,7 +684,7 @@ $this->_options = array(); $this->_choice = false; } - + /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. @@ -695,7 +695,7 @@ $this->_options[] = $tag; } } - + /** * Text within the selection element is ignored. * @param string $content Ignored. @@ -703,7 +703,7 @@ */ function addContent($content) { } - + /** * Scans options for defaults. If none, then * the first option is selected. @@ -721,7 +721,7 @@ } return ''; } - + /** * Can only set allowed values. * @param string $value New choice. @@ -737,7 +737,7 @@ } return false; } - + /** * Accessor for current selection value. * @return string Value attribute or @@ -751,7 +751,7 @@ return $this->_options[$this->_choice]->getValue(); } } - + /** * Drop down widget. * @package SimpleTest @@ -760,7 +760,7 @@ class MultipleSelectionTag extends SimpleWidget { protected $_options; protected $_values; - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -771,7 +771,7 @@ $this->_options = array(); $this->_values = false; } - + /** * Adds an option tag to a selection field. * @param SimpleOptionTag $tag New option. @@ -782,7 +782,7 @@ $this->_options[] = $tag; } } - + /** * Text within the selection element is ignored. * @param string $content Ignored. @@ -790,7 +790,7 @@ */ function addContent($content) { } - + /** * Scans options for defaults to populate the * value array(). @@ -806,7 +806,7 @@ } return $default; } - + /** * Can only set allowed values. Any illegal value * will result in a failure, but all correct values @@ -833,7 +833,7 @@ $this->_values = $achieved; return true; } - + /** * Accessor for current selection value. * @return array List of currently set options. @@ -846,21 +846,21 @@ return $this->_values; } } - + /** * Option for selection field. * @package SimpleTest * @subpackage WebTester */ class SimpleOptionTag extends SimpleWidget { - + /** * Stashes the attributes. */ function SimpleOptionTag($attributes) { $this->SimpleWidget('option', $attributes); } - + /** * Does nothing. * @param string $value Ignored. @@ -870,7 +870,7 @@ function setValue($value) { return false; } - + /** * Test to see if a value matches the option. * @param string $compare Value to compare with. @@ -884,7 +884,7 @@ } return trim($this->getContent()) == $compare; } - + /** * Accessor for starting value. Will be set to * the option label if no value exists. @@ -897,7 +897,7 @@ } return $this->getAttribute('value'); } - + /** * The content of options is not part of the page. * @return boolean True. @@ -907,14 +907,14 @@ return true; } } - + /** * Radio button. * @package SimpleTest * @subpackage WebTester */ class SimpleRadioButtonTag extends SimpleWidget { - + /** * Stashes the attributes. * @param array $attributes Hash of attributes. @@ -925,7 +925,7 @@ $this->_setAttribute('value', 'on'); } } - + /** * Tag contains no content. * @return boolean False. @@ -934,7 +934,7 @@ function expectEndTag() { return false; } - + /** * The only allowed value sn the one in the * "value" attribute. @@ -951,7 +951,7 @@ } return parent::setValue($value); } - + /** * Accessor for starting value. * @return string Parsed value. @@ -964,14 +964,14 @@ return false; } } - + /** * Checkbox widget. * @package SimpleTest * @subpackage WebTester */ class SimpleCheckboxTag extends SimpleWidget { - + /** * Starts with attributes only. * @param hash $attributes Attribute names and @@ -983,7 +983,7 @@ $this->_setAttribute('value', 'on'); } } - + /** * Tag contains no content. * @return boolean False. @@ -992,7 +992,7 @@ function expectEndTag() { return false; } - + /** * The only allowed value in the one in the * "value" attribute. The default for this @@ -1014,7 +1014,7 @@ } return parent::setValue($value); } - + /** * Accessor for starting value. The default * value is "on". @@ -1028,7 +1028,7 @@ return false; } } - + /** * A group of multiple widgets with some shared behaviour. * @package SimpleTest @@ -1045,7 +1045,7 @@ function addWidget($widget) { $this->_widgets[] = $widget; } - + /** * Accessor to widget set. * @return array All widgets. @@ -1064,7 +1064,7 @@ function getAttribute($label) { return false; } - + /** * Fetches the name for the widget from the first * member. @@ -1076,7 +1076,7 @@ return $this->_widgets[0]->getName(); } } - + /** * Scans the widgets for one with the appropriate * ID field. @@ -1092,7 +1092,7 @@ } return false; } - + /** * Scans the widgets for one with the appropriate * attached label. @@ -1108,7 +1108,7 @@ } return false; } - + /** * Dispatches the value into the form encoded packet. * @param SimpleEncoding $encoding Form packet. @@ -1125,7 +1125,7 @@ * @subpackage WebTester */ class SimpleCheckboxGroup extends SimpleTagGroup { - + /** * Accessor for current selected widget or false * if none. @@ -1142,7 +1142,7 @@ } return $this->_coerceValues($values); } - + /** * Accessor for starting value that is active. * @return string/array Widget values or false if none. @@ -1158,7 +1158,7 @@ } return $this->_coerceValues($values); } - + /** * Accessor for current set values. * @param string/array/boolean $values Either a single string, a @@ -1182,7 +1182,7 @@ } return true; } - + /** * Tests to see if a possible value set is legal. * @param string/array/boolean $values Either a single string, a @@ -1202,7 +1202,7 @@ } return ($values == $matches); } - + /** * Converts the output to an appropriate format. This means * that no values is false, a single value is just that @@ -1220,7 +1220,7 @@ return $values; } } - + /** * Converts false or string into array. The opposite of * the coercian method. @@ -1248,7 +1248,7 @@ * @subpackage WebTester */ class SimpleRadioGroup extends SimpleTagGroup { - + /** * Each tag is tried in turn until one is * successfully set. The others will be @@ -1270,7 +1270,7 @@ } return true; } - + /** * Tests to see if a value is allowed. * @param string Attempted value. @@ -1286,7 +1286,7 @@ } return false; } - + /** * Accessor for current selected widget or false * if none. @@ -1303,7 +1303,7 @@ } return false; } - + /** * Accessor for starting value that is active. * @return string/boolean Value of first checked @@ -1320,14 +1320,14 @@ return false; } } - + /** * Tag to keep track of labels. * @package SimpleTest * @subpackage WebTester */ class SimpleLabelTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1336,7 +1336,7 @@ function SimpleLabelTag($attributes) { $this->SimpleTag('label', $attributes); } - + /** * Access for the ID to attach the label to. * @return string For attribute. @@ -1346,14 +1346,14 @@ return $this->getAttribute('for'); } } - + /** * Tag to aid parsing the form. * @package SimpleTest * @subpackage WebTester */ class SimpleFormTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1363,14 +1363,14 @@ $this->SimpleTag('form', $attributes); } } - + /** * Tag to aid parsing the frames in a page. * @package SimpleTest * @subpackage WebTester */ class SimpleFrameTag extends SimpleTag { - + /** * Starts with a named tag with attributes only. * @param hash $attributes Attribute names and @@ -1379,7 +1379,7 @@ function SimpleFrameTag($attributes) { $this->SimpleTag('frame', $attributes); } - + /** * Tag contains no content. * @return boolean False. @@ -1388,5 +1388,4 @@ function expectEndTag() { return false; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/test_case.php b/tests/test_tools/simpletest/test_case.php index 91a356d8..74253d80 100644 --- a/tests/test_tools/simpletest/test_case.php +++ b/tests/test_tools/simpletest/test_case.php @@ -687,4 +687,3 @@ return 0; } } -?> diff --git a/tests/test_tools/simpletest/unit_tester.php b/tests/test_tools/simpletest/unit_tester.php index 7a382b5f..672a3050 100644 --- a/tests/test_tools/simpletest/unit_tester.php +++ b/tests/test_tools/simpletest/unit_tester.php @@ -370,4 +370,3 @@ return $this->assertError(new PatternExpectation($pattern), $message); } } -?> diff --git a/tests/test_tools/simpletest/url.php b/tests/test_tools/simpletest/url.php index b208d1b3..dedc6a9b 100644 --- a/tests/test_tools/simpletest/url.php +++ b/tests/test_tools/simpletest/url.php @@ -521,5 +521,4 @@ static function getAllTopLevelDomains() { return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum'; } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/user_agent.php b/tests/test_tools/simpletest/user_agent.php index a901e6d4..161a1b68 100644 --- a/tests/test_tools/simpletest/user_agent.php +++ b/tests/test_tools/simpletest/user_agent.php @@ -14,11 +14,11 @@ require_once(dirname(__FILE__) . '/encoding.php'); require_once(dirname(__FILE__) . '/authentication.php'); /**#@-*/ - + if (! defined('DEFAULT_MAX_REDIRECTS')) { define('DEFAULT_MAX_REDIRECTS', 3); } - + if (! defined('DEFAULT_CONNECTION_TIMEOUT')) { define('DEFAULT_CONNECTION_TIMEOUT', 15); } @@ -39,7 +39,7 @@ protected $_proxy_password = false; protected $_connection_timeout = DEFAULT_CONNECTION_TIMEOUT; protected $_additional_headers = array(); - + /** * Starts with no cookies, realms or proxies. * @access public @@ -48,7 +48,7 @@ $this->_cookie_jar = new SimpleCookieJar(); $this->_authenticator = new SimpleAuthenticator(); } - + /** * Removes expired and temporary cookies as if * the browser was closed and re-opened. Authorisation @@ -62,7 +62,7 @@ $this->_cookie_jar->restartSession($date); $this->_authenticator->restartSession(); } - + /** * Adds a header to every fetch. * @param string $header Header line to add to every @@ -72,7 +72,7 @@ function addHeader($header) { $this->_additional_headers[] = $header; } - + /** * Ages the cookies by the specified time. * @param integer $interval Amount in seconds. @@ -81,7 +81,7 @@ function ageCookies($interval) { $this->_cookie_jar->agePrematurely($interval); } - + /** * Sets an additional cookie. If a cookie has * the same name and path it is replaced. @@ -95,7 +95,7 @@ function setCookie($name, $value, $host = false, $path = '/', $expiry = false) { $this->_cookie_jar->setCookie($name, $value, $host, $path, $expiry); } - + /** * Reads the most specific cookie value from the * browser cookies. @@ -109,7 +109,7 @@ function getCookieValue($host, $path, $name) { return $this->_cookie_jar->getCookieValue($host, $path, $name); } - + /** * Reads the current cookies within the base URL. * @param string $name Key of cookie to find. @@ -124,7 +124,7 @@ } return $this->getCookieValue($base->getHost(), $base->getPath(), $name); } - + /** * Switches off cookie sending and recieving. * @access public @@ -132,7 +132,7 @@ function ignoreCookies() { $this->_cookies_enabled = false; } - + /** * Switches back on the cookie sending and recieving. * @access public @@ -140,7 +140,7 @@ function useCookies() { $this->_cookies_enabled = true; } - + /** * Sets the socket timeout for opening a connection. * @param integer $timeout Maximum time in seconds. @@ -149,7 +149,7 @@ function setConnectionTimeout($timeout) { $this->_connection_timeout = $timeout; } - + /** * Sets the maximum number of redirects before * a page will be loaded anyway. @@ -159,7 +159,7 @@ function setMaximumRedirects($max) { $this->_max_redirects = $max; } - + /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL @@ -181,7 +181,7 @@ $this->_proxy_username = $username; $this->_proxy_password = $password; } - + /** * Test to see if the redirect limit is passed. * @param integer $redirects Count so far. @@ -191,7 +191,7 @@ function _isTooManyRedirects($redirects) { return ($redirects > $this->_max_redirects); } - + /** * Sets the identity for the current realm. * @param string $host Host to which realm applies. @@ -203,7 +203,7 @@ function setIdentity($host, $realm, $username, $password) { $this->_authenticator->setIdentityForRealm($host, $realm, $username, $password); } - + /** * Fetches a URL as a response object. Will keep trying if redirected. * It will also collect authentication realm information. @@ -228,7 +228,7 @@ } return $response; } - + /** * Fetches the page until no longer redirected or * until the redirect limit runs out. @@ -257,7 +257,7 @@ } while (! $this->_isTooManyRedirects(++$redirects)); return $response; } - + /** * Actually make the web request. * @param SimpleUrl $url Target to fetch. @@ -270,7 +270,7 @@ $response = $request->fetch($this->_connection_timeout); return $response; } - + /** * Creates a full page request. * @param SimpleUrl $url Target to fetch as url object. @@ -287,7 +287,7 @@ $this->_authenticator->addHeaders($request, $url); return $request; } - + /** * Builds the appropriate HTTP request object. * @param SimpleUrl $url Target to fetch as url object. @@ -299,7 +299,7 @@ $request = new SimpleHttpRequest($this->_createRoute($url), $encoding); return $request; } - + /** * Sets up either a direct route or via a proxy. * @param SimpleUrl $url Target to fetch as url object. @@ -318,7 +318,7 @@ } return $route; } - + /** * Adds additional manual headers. * @param SimpleHttpRequest $request Outgoing request. @@ -329,5 +329,4 @@ $request->addHeaderLine($header); } } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/web_tester.php b/tests/test_tools/simpletest/web_tester.php index c582a6ff..c6a48110 100644 --- a/tests/test_tools/simpletest/web_tester.php +++ b/tests/test_tools/simpletest/web_tester.php @@ -14,7 +14,7 @@ require_once(dirname(__FILE__) . '/page.php'); require_once(dirname(__FILE__) . '/expectation.php'); /**#@-*/ - + /** * Test for an HTML widget value match. * @package SimpleTest @@ -22,7 +22,7 @@ */ class FieldExpectation extends SimpleExpectation { protected $_value; - + /** * Sets the field value to compare against. * @param mixed $value Test value to match. Can be an @@ -38,7 +38,7 @@ } $this->_value = $value; } - + /** * Tests the expectation. True if it matches * a string value or an array value in any order. @@ -59,7 +59,7 @@ } return false; } - + /** * Tests for valid field comparisons with a single option. * @param mixed $value Value to type check. @@ -69,7 +69,7 @@ function _isSingle($value) { return is_string($value) || is_integer($value) || is_float($value); } - + /** * String comparison for simple field with a single option. * @param mixed $compare String to test against. @@ -85,7 +85,7 @@ } return ($this->_value == $compare); } - + /** * List comparison for multivalue field. * @param mixed $compare List in any order to test against. @@ -102,7 +102,7 @@ sort($compare); return ($this->_value === $compare); } - + /** * Returns a human readable test message. * @param mixed $compare Comparison value. @@ -125,7 +125,7 @@ } } } - + /** * Test for a specific HTTP header within a header block. * @package SimpleTest @@ -134,7 +134,7 @@ class HttpHeaderExpectation extends SimpleExpectation { protected $_expected_header; protected $_expected_value; - + /** * Sets the field and value to compare against. * @param string $header Case insenstive trimmed header name. @@ -150,7 +150,7 @@ $this->_expected_header = $this->_normaliseHeader($header); $this->_expected_value = $value; } - + /** * Accessor for aggregated object. * @return mixed Expectation set in constructor. @@ -159,7 +159,7 @@ function _getExpectation() { return $this->_expected_value; } - + /** * Removes whitespace at ends and case variations. * @param string $header Name of header. @@ -170,7 +170,7 @@ function _normaliseHeader($header) { return strtolower(trim($header)); } - + /** * Tests the expectation. True if it matches * a string value or an array value in any order. @@ -181,7 +181,7 @@ function test($compare) { return is_string($this->_findHeader($compare)); } - + /** * Searches the incoming result. Will extract the matching * line as text. @@ -198,7 +198,7 @@ } return false; } - + /** * Compares a single header line against the expectation. * @param string $line A single line to compare. @@ -215,7 +215,7 @@ } return $this->_testHeaderValue($value, $this->_expected_value); } - + /** * Tests the value part of the header. * @param string $value Value to test. @@ -232,7 +232,7 @@ } return (trim($value) == trim($expected)); } - + /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. @@ -254,7 +254,7 @@ } } } - + /** * Test for a specific HTTP header within a header block that * should not be found. @@ -264,7 +264,7 @@ class NoHttpHeaderExpectation extends HttpHeaderExpectation { protected $_expected_header; protected $_expected_value; - + /** * Sets the field and value to compare against. * @param string $unwanted Case insenstive trimmed header name. @@ -274,7 +274,7 @@ function NoHttpHeaderExpectation($unwanted, $message = '%s') { $this->HttpHeaderExpectation($unwanted, false, $message); } - + /** * Tests that the unwanted header is not found. * @param mixed $compare Raw header block to search. @@ -284,7 +284,7 @@ function test($compare) { return ($this->_findHeader($compare) === false); } - + /** * Returns a human readable test message. * @param mixed $compare Raw header block to search. @@ -301,7 +301,7 @@ } } } - + /** * Test for a text substring. * @package SimpleTest @@ -309,7 +309,7 @@ */ class TextExpectation extends SimpleExpectation { protected $_substring; - + /** * Sets the value to compare against. * @param string $substring Text to search for. @@ -320,7 +320,7 @@ $this->SimpleExpectation($message); $this->_substring = $substring; } - + /** * Accessor for the substring. * @return string Text to match. @@ -329,7 +329,7 @@ function _getSubstring() { return $this->_substring; } - + /** * Tests the expectation. True if the text contains the * substring. @@ -340,7 +340,7 @@ function test($compare) { return (strpos($compare, $this->_substring) !== false); } - + /** * Returns a human readable test message. * @param mixed $compare Comparison value. @@ -358,7 +358,7 @@ $dumper->describeValue($compare) . "]"; } } - + /** * Describes a pattern match including the string * found and it's position. @@ -374,7 +374,7 @@ $dumper->clipString($subject, 100, $position) . "]"; } } - + /** * Fail if a substring is detected within the * comparison text. @@ -382,7 +382,7 @@ * @subpackage UnitTester */ class NoTextExpectation extends TextExpectation { - + /** * Sets the reject pattern * @param string $substring Text to search for. @@ -392,7 +392,7 @@ function NoTextExpectation($substring, $message = '%s') { $this->TextExpectation($substring, $message); } - + /** * Tests the expectation. False if the substring appears * in the text. @@ -403,7 +403,7 @@ function test($compare) { return ! parent::test($compare); } - + /** * Returns a human readable test message. * @param string $compare Comparison value. @@ -422,7 +422,7 @@ } } } - + /** * Test case for testing of web pages. Allows * fetching of pages, parsing of HTML and @@ -433,7 +433,7 @@ class WebTestCase extends SimpleTestCase { protected $_browser; protected $_ignore_errors = false; - + /** * Creates an empty test case. Should be subclassed * with test methods for a functional test case. @@ -444,7 +444,7 @@ function WebTestCase($label = false) { $this->SimpleTestCase($label); } - + /** * Announces the start of the test. * @param string $method Test method just started. @@ -464,7 +464,7 @@ $this->unsetBrowser(); parent::after($method); } - + /** * Gets a current browser reference for setting * special expectations or for detailed @@ -475,7 +475,7 @@ function &getBrowser() { return $this->_browser; } - + /** * Gets a current browser reference for setting * special expectations or for detailed @@ -486,7 +486,7 @@ function setBrowser($browser) { return $this->_browser = $browser; } - + /** * Clears the current browser reference to help the * PHP garbage collector. @@ -495,7 +495,7 @@ function unsetBrowser() { unset($this->_browser); } - + /** * Creates a new default web browser object. * Will be cleared at the end of the test method. @@ -506,7 +506,7 @@ $browser = new SimpleBrowser(); return $browser; } - + /** * Gets the last response error. * @return string Last low level HTTP error. @@ -515,7 +515,7 @@ function getTransportError() { return $this->_browser->getTransportError(); } - + /** * Accessor for the currently selected URL. * @return string Current location or false if @@ -525,7 +525,7 @@ function getUrl() { return $this->_browser->getUrl(); } - + /** * Dumps the current request for debugging. * @access public @@ -533,7 +533,7 @@ function showRequest() { $this->dump($this->_browser->getRequest()); } - + /** * Dumps the current HTTP headers for debugging. * @access public @@ -541,7 +541,7 @@ function showHeaders() { $this->dump($this->_browser->getHeaders()); } - + /** * Dumps the current HTML source for debugging. * @access public @@ -549,7 +549,7 @@ function showSource() { $this->dump($this->_browser->getContent()); } - + /** * Dumps the visible text only for debugging. * @access public @@ -557,7 +557,7 @@ function showText() { $this->dump(wordwrap($this->_browser->getContentAsText(), 80)); } - + /** * Simulates the closing and reopening of the browser. * Temporary cookies will be discarded and timed @@ -575,7 +575,7 @@ } $this->_browser->restart($date); } - + /** * Moves cookie expiry times back into the past. * Useful for testing timeouts and expiries. @@ -585,7 +585,7 @@ function ageCookies($interval) { $this->_browser->ageCookies($interval); } - + /** * Disables frames support. Frames will not be fetched * and the frameset page will be used instead. @@ -594,7 +594,7 @@ function ignoreFrames() { $this->_browser->ignoreFrames(); } - + /** * Switches off cookie sending and recieving. * @access public @@ -602,7 +602,7 @@ function ignoreCookies() { $this->_browser->ignoreCookies(); } - + /** * Skips errors for the next request only. You might * want to confirm that a page is unreachable for @@ -612,7 +612,7 @@ function ignoreErrors() { $this->_ignore_errors = true; } - + /** * Issues a fail if there is a transport error anywhere * in the current frameset. Only one such error is @@ -640,7 +640,7 @@ function addHeader($header) { $this->_browser->addHeader($header); } - + /** * Sets the maximum number of redirects before * the web page is loaded regardless. @@ -654,7 +654,7 @@ } $this->_browser->setMaximumRedirects($max); } - + /** * Sets the socket timeout for opening a connection and * receiving at least one byte of information. @@ -664,7 +664,7 @@ function setConnectionTimeout($timeout) { $this->_browser->setConnectionTimeout($timeout); } - + /** * Sets proxy to use on all requests for when * testing from behind a firewall. Set URL @@ -677,7 +677,7 @@ function useProxy($proxy, $username = false, $password = false) { $this->_browser->useProxy($proxy, $username, $password); } - + /** * Fetches a page into the page buffer. If * there is no base for the URL then the @@ -691,7 +691,7 @@ function get($url, $parameters = false) { return $this->_failOnError($this->_browser->get($url, $parameters)); } - + /** * Fetches a page by POST into the page buffer. * If there is no base for the URL then the @@ -705,7 +705,7 @@ function post($url, $parameters = false) { return $this->_failOnError($this->_browser->post($url, $parameters)); } - + /** * Does a HTTP HEAD fetch, fetching only the page * headers. The current base URL is unchanged by this. @@ -717,7 +717,7 @@ function head($url, $parameters = false) { return $this->_failOnError($this->_browser->head($url, $parameters)); } - + /** * Equivalent to hitting the retry button on the * browser. Will attempt to repeat the page fetch. @@ -727,7 +727,7 @@ function retry() { return $this->_failOnError($this->_browser->retry()); } - + /** * Equivalent to hitting the back button on the * browser. @@ -738,7 +738,7 @@ function back() { return $this->_failOnError($this->_browser->back()); } - + /** * Equivalent to hitting the forward button on the * browser. @@ -749,7 +749,7 @@ function forward() { return $this->_failOnError($this->_browser->forward()); } - + /** * Retries a request after setting the authentication * for the current realm. @@ -764,7 +764,7 @@ return $this->_failOnError( $this->_browser->authenticate($username, $password)); } - + /** * Gets the cookie value for the current browser context. * @param string $name Name of cookie. @@ -774,7 +774,7 @@ function getCookie($name) { return $this->_browser->getCurrentCookieValue($name); } - + /** * Sets a cookie in the current browser. * @param string $name Name of cookie. @@ -787,7 +787,7 @@ function setCookie($name, $value, $host = false, $path = "/", $expiry = false) { $this->_browser->setCookie($name, $value, $host, $path, $expiry); } - + /** * Accessor for current frame focus. Will be * false if no frame has focus. @@ -799,7 +799,7 @@ function getFrameFocus() { return $this->_browser->getFrameFocus(); } - + /** * Sets the focus by index. The integer index starts from 1. * @param integer $choice Chosen frame. @@ -809,7 +809,7 @@ function setFrameFocusByIndex($choice) { return $this->_browser->setFrameFocusByIndex($choice); } - + /** * Sets the focus by name. * @param string $name Chosen frame. @@ -819,7 +819,7 @@ function setFrameFocus($name) { return $this->_browser->setFrameFocus($name); } - + /** * Clears the frame focus. All frames will be searched * for content. @@ -828,7 +828,7 @@ function clearFrameFocus() { return $this->_browser->clearFrameFocus(); } - + /** * Clicks a visible text item. Will first try buttons, * then links and then images. @@ -839,7 +839,7 @@ function click($label) { return $this->_failOnError($this->_browser->click($label)); } - + /** * Clicks the submit button by label. The owning * form will be submitted by this. @@ -853,7 +853,7 @@ return $this->_failOnError( $this->_browser->clickSubmit($label, $additional)); } - + /** * Clicks the submit button by name attribute. The owning * form will be submitted by this. @@ -866,7 +866,7 @@ return $this->_failOnError( $this->_browser->clickSubmitByName($name, $additional)); } - + /** * Clicks the submit button by ID attribute. The owning * form will be submitted by this. @@ -879,7 +879,7 @@ return $this->_failOnError( $this->_browser->clickSubmitById($id, $additional)); } - + /** * Clicks the submit image by some kind of label. Usually * the alt tag or the nearest equivalent. The owning @@ -897,7 +897,7 @@ return $this->_failOnError( $this->_browser->clickImage($label, $x, $y, $additional)); } - + /** * Clicks the submit image by the name. Usually * the alt tag or the nearest equivalent. The owning @@ -915,7 +915,7 @@ return $this->_failOnError( $this->_browser->clickImageByName($name, $x, $y, $additional)); } - + /** * Clicks the submit image by ID attribute. The owning * form will be submitted by this. Clicking outside of @@ -932,7 +932,7 @@ return $this->_failOnError( $this->_browser->clickImageById($id, $x, $y, $additional)); } - + /** * Submits a form by the ID. * @param string $id Form ID. No button information @@ -943,7 +943,7 @@ function submitFormById($id) { return $this->_failOnError($this->_browser->submitFormById($id)); } - + /** * Follows a link by name. Will click the first link * found with this link text by default, or a later @@ -957,7 +957,7 @@ function clickLink($label, $index = 0) { return $this->_failOnError($this->_browser->clickLink($label, $index)); } - + /** * Follows a link by id attribute. * @param string $id ID attribute value. @@ -967,7 +967,7 @@ function clickLinkById($id) { return $this->_failOnError($this->_browser->clickLinkById($id)); } - + /** * Will trigger a pass if the two parameters have * the same value only. Otherwise a fail. This @@ -984,7 +984,7 @@ $second, $message); } - + /** * Will trigger a pass if the two parameters have * a different value. Otherwise a fail. This @@ -1001,7 +1001,7 @@ $second, $message); } - + /** * Tests for the presence of a link label. Match is * case insensitive with normalised space. @@ -1032,7 +1032,7 @@ $this->_browser->isLink($label), sprintf($message, "Link [$label] should not exist")); } - + /** * Tests for the presence of a link id attribute. * @param string $id Id attribute value. @@ -1061,7 +1061,7 @@ $this->_browser->isLinkById($id), sprintf($message, "Link ID [$id] should not exist")); } - + /** * Sets all form fields with that label, or name if there * is no label attached. @@ -1073,7 +1073,7 @@ function setField($label, $value) { return $this->_browser->setField($label, $value); } - + /** * Sets all form fields with that name. * @param string $name Name of field in forms. @@ -1084,7 +1084,7 @@ function setFieldByName($name, $value) { return $this->_browser->setFieldByName($name, $value); } - + /** * Sets all form fields with that name. * @param string/integer $id Id of field in forms. @@ -1095,7 +1095,7 @@ function setFieldById($id, $value) { return $this->_browser->setFieldById($id, $value); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form will always @@ -1113,7 +1113,7 @@ $value = $this->_browser->getField($label); return $this->_assertFieldValue($label, $value, $expected, $message); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form element will always @@ -1131,7 +1131,7 @@ $value = $this->_browser->getFieldByName($name); return $this->_assertFieldValue($name, $value, $expected, $message); } - + /** * Confirms that the form element is currently set * to the expected value. A missing form will always @@ -1149,7 +1149,7 @@ $value = $this->_browser->getFieldById($id); return $this->_assertFieldValue($id, $value, $expected, $message); } - + /** * Tests the field value against the expectation. * @param string $identifier Name, ID or label. @@ -1173,7 +1173,7 @@ } return $this->assert($expected, $value, $message); } - + /** * Checks the response code against a list * of possible values. @@ -1190,7 +1190,7 @@ implode(", ", $responses) . "] got [$code]"); return $this->assertTrue(in_array($code, $responses), $message); } - + /** * Checks the mime type against a list * of possible values. @@ -1206,7 +1206,7 @@ implode(", ", $types) . "] got [$type]"); return $this->assertTrue(in_array($type, $types), $message); } - + /** * Attempt to match the authentication type within * the security realm we are currently matching. @@ -1230,7 +1230,7 @@ $message); } } - + /** * Checks that no authentication is necessary to view * the desired page. @@ -1243,7 +1243,7 @@ $this->_browser->getAuthentication() . "]"); return $this->assertFalse($this->_browser->getAuthentication(), $message); } - + /** * Attempts to match the current security realm. * @param string $realm Name of security realm. @@ -1260,7 +1260,7 @@ $this->_browser->getRealm(), "Expected realm -> $message"); } - + /** * Checks each header line for the required value. If no * value is given then only an existence check is made. @@ -1277,7 +1277,7 @@ $this->_browser->getHeaders(), $message); } - + /** * @deprecated */ @@ -1303,14 +1303,14 @@ $this->_browser->getHeaders(), $message); } - + /** * @deprecated */ function assertNoUnwantedHeader($header, $message = '%s') { return $this->assertNoHeader($header, $message); } - + /** * Tests the text between the title tags. * @param string $title Expected title. @@ -1324,7 +1324,7 @@ } return $this->assert($title, $this->_browser->getTitle(), $message); } - + /** * Will trigger a pass if the text is found in the plain * text form of the page. @@ -1339,14 +1339,14 @@ $this->_browser->getContentAsText(), $message); } - + /** * @deprecated */ function assertWantedText($text, $message = '%s') { return $this->assertText($text, $message); } - + /** * Will trigger a pass if the text is not found in the plain * text form of the page. @@ -1361,14 +1361,14 @@ $this->_browser->getContentAsText(), $message); } - + /** * @deprecated */ function assertNoUnwantedText($text, $message = '%s') { return $this->assertNoText($text, $message); } - + /** * Will trigger a pass if the Perl regex pattern * is found in the raw content. @@ -1384,14 +1384,14 @@ $this->_browser->getContent(), $message); } - + /** * @deprecated */ function assertWantedPattern($pattern, $message = '%s') { return $this->assertPattern($pattern, $message); } - + /** * Will trigger a pass if the perl regex pattern * is not present in raw content. @@ -1407,14 +1407,14 @@ $this->_browser->getContent(), $message); } - + /** * @deprecated */ function assertNoUnwantedPattern($pattern, $message = '%s') { return $this->assertNoPattern($pattern, $message); } - + /** * Checks that a cookie is set for the current page * and optionally checks the value. @@ -1437,7 +1437,7 @@ } return $this->assert($expected, $value, "Expecting cookie [$name] -> $message"); } - + /** * Checks that no cookie is present or that it has * been successfully cleared. @@ -1451,5 +1451,4 @@ $this->getCookie($name) === false, sprintf($message, "Not expecting cookie [$name]")); } - } -?>
\ No newline at end of file + }
\ No newline at end of file diff --git a/tests/test_tools/simpletest/xml.php b/tests/test_tools/simpletest/xml.php index 9d1ab3b2..54b53011 100644 --- a/tests/test_tools/simpletest/xml.php +++ b/tests/test_tools/simpletest/xml.php @@ -611,4 +611,3 @@ function _default($expat, $default) { } } -?> |