@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @access public |
| 32 | 32 | */ |
| 33 | 33 | static function ignore($class) { |
| 34 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 34 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 35 | 35 | $registry['IgnoreList'][] = strtolower($class); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @static |
| 45 | 45 | */ |
| 46 | 46 | static function isIgnored($class) { |
| 47 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 47 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 48 | 48 | return in_array(strtolower($class), $registry['IgnoreList']); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @access public |
| 60 | 60 | */ |
| 61 | 61 | static function setStubBaseClass($stub_base) { |
| 62 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 62 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 63 | 63 | $registry['StubBaseClass'] = $stub_base; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @access public |
| 71 | 71 | */ |
| 72 | 72 | static function getStubBaseClass() { |
| 73 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 73 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 74 | 74 | return $registry['StubBaseClass']; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @access public |
| 86 | 86 | */ |
| 87 | 87 | static function setMockBaseClass($mock_base) { |
| 88 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 88 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 89 | 89 | $registry['MockBaseClass'] = $mock_base; |
| 90 | 90 | } |
| 91 | 91 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @access public |
| 97 | 97 | */ |
| 98 | 98 | static function getMockBaseClass() { |
| 99 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 99 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 100 | 100 | return $registry['MockBaseClass']; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @access public |
| 111 | 111 | */ |
| 112 | 112 | static function addPartialMockCode($code = '') { |
| 113 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 113 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 114 | 114 | $registry['AdditionalPartialMockCode'] = $code; |
| 115 | 115 | } |
| 116 | 116 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @access public |
| 121 | 121 | */ |
| 122 | 122 | function getPartialMockCode() { |
| 123 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 123 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 124 | 124 | return $registry['AdditionalPartialMockCode']; |
| 125 | 125 | } |
| 126 | 126 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * @access public |
| 136 | 136 | */ |
| 137 | 137 | static function useProxy($proxy, $username = false, $password = false) { |
| 138 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 138 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 139 | 139 | $registry['DefaultProxy'] = $proxy; |
| 140 | 140 | $registry['DefaultProxyUsername'] = $username; |
| 141 | 141 | $registry['DefaultProxyPassword'] = $password; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * @access public |
| 148 | 148 | */ |
| 149 | 149 | function getDefaultProxy() { |
| 150 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 150 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 151 | 151 | return $registry['DefaultProxy']; |
| 152 | 152 | } |
| 153 | 153 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @access public |
| 158 | 158 | */ |
| 159 | 159 | function getDefaultProxyUsername() { |
| 160 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 160 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 161 | 161 | return $registry['DefaultProxyUsername']; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * @access public |
| 168 | 168 | */ |
| 169 | 169 | function getDefaultProxyPassword() { |
| 170 | - $registry =SimpleTestOptions::_getRegistry(); |
|
| 170 | + $registry = SimpleTestOptions::_getRegistry(); |
|
| 171 | 171 | return $registry['DefaultProxyPassword']; |
| 172 | 172 | } |
| 173 | 173 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | static function _getRegistry() { |
| 181 | 181 | static $registry = false; |
| 182 | - if (! $registry) { |
|
| 182 | + if (!$registry) { |
|
| 183 | 183 | $registry = SimpleTestOptions::_getDefaults(); |
| 184 | 184 | } |
| 185 | 185 | return $registry; |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $is_identical = SimpleTestCompatibility::_isIdenticalType( |
| 270 | 270 | $first[$key], |
| 271 | 271 | $second[$key]); |
| 272 | - if (! $is_identical) { |
|
| 272 | + if (!$is_identical) { |
|
| 273 | 273 | return false; |
| 274 | 274 | } |
| 275 | 275 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | */ |
| 306 | 306 | static function isA($object, $class) { |
| 307 | 307 | if (version_compare(phpversion(), '5') >= 0) { |
| 308 | - if (! class_exists($class, false)) { |
|
| 308 | + if (!class_exists($class, false)) { |
|
| 309 | 309 | return false; |
| 310 | 310 | } |
| 311 | 311 | eval("\$is_a = \$object instanceof $class;"); |
@@ -9,19 +9,19 @@ discard block |
||
| 9 | 9 | /**#@+ |
| 10 | 10 | * Lexer mode stack constants |
| 11 | 11 | */ |
| 12 | - if (! defined('LEXER_ENTER')) { |
|
| 12 | + if (!defined('LEXER_ENTER')) { |
|
| 13 | 13 | define('LEXER_ENTER', 1); |
| 14 | 14 | } |
| 15 | - if (! defined('LEXER_MATCHED')) { |
|
| 15 | + if (!defined('LEXER_MATCHED')) { |
|
| 16 | 16 | define('LEXER_MATCHED', 2); |
| 17 | 17 | } |
| 18 | - if (! defined('LEXER_UNMATCHED')) { |
|
| 18 | + if (!defined('LEXER_UNMATCHED')) { |
|
| 19 | 19 | define('LEXER_UNMATCHED', 3); |
| 20 | 20 | } |
| 21 | - if (! defined('LEXER_EXIT')) { |
|
| 21 | + if (!defined('LEXER_EXIT')) { |
|
| 22 | 22 | define('LEXER_EXIT', 4); |
| 23 | 23 | } |
| 24 | - if (! defined('LEXER_SPECIAL')) { |
|
| 24 | + if (!defined('LEXER_SPECIAL')) { |
|
| 25 | 25 | define('LEXER_SPECIAL', 5); |
| 26 | 26 | } |
| 27 | 27 | /**#@-*/ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if (count($this->_patterns) == 0) { |
| 81 | 81 | return false; |
| 82 | 82 | } |
| 83 | - if (! preg_match($this->_getCompoundedRegex(), $subject, $matches)) { |
|
| 83 | + if (!preg_match($this->_getCompoundedRegex(), $subject, $matches)) { |
|
| 84 | 84 | $match = ''; |
| 85 | 85 | return false; |
| 86 | 86 | } |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | * @access public |
| 222 | 222 | */ |
| 223 | 223 | function addPattern($pattern, $mode = "accept") { |
| 224 | - if (! isset($this->_regexes[$mode])) { |
|
| 224 | + if (!isset($this->_regexes[$mode])) { |
|
| 225 | 225 | $this->_regexes[$mode] = new ParallelRegex($this->_case); |
| 226 | 226 | } |
| 227 | 227 | $this->_regexes[$mode]->addPattern($pattern); |
| 228 | - if (! isset($this->_mode_handlers[$mode])) { |
|
| 228 | + if (!isset($this->_mode_handlers[$mode])) { |
|
| 229 | 229 | $this->_mode_handlers[$mode] = $mode; |
| 230 | 230 | } |
| 231 | 231 | } |
@@ -244,11 +244,11 @@ discard block |
||
| 244 | 244 | * @access public |
| 245 | 245 | */ |
| 246 | 246 | function addEntryPattern($pattern, $mode, $new_mode) { |
| 247 | - if (! isset($this->_regexes[$mode])) { |
|
| 247 | + if (!isset($this->_regexes[$mode])) { |
|
| 248 | 248 | $this->_regexes[$mode] = new ParallelRegex($this->_case); |
| 249 | 249 | } |
| 250 | 250 | $this->_regexes[$mode]->addPattern($pattern, $new_mode); |
| 251 | - if (! isset($this->_mode_handlers[$new_mode])) { |
|
| 251 | + if (!isset($this->_mode_handlers[$new_mode])) { |
|
| 252 | 252 | $this->_mode_handlers[$new_mode] = $new_mode; |
| 253 | 253 | } |
| 254 | 254 | } |
@@ -262,11 +262,11 @@ discard block |
||
| 262 | 262 | * @access public |
| 263 | 263 | */ |
| 264 | 264 | function addExitPattern($pattern, $mode) { |
| 265 | - if (! isset($this->_regexes[$mode])) { |
|
| 265 | + if (!isset($this->_regexes[$mode])) { |
|
| 266 | 266 | $this->_regexes[$mode] = new ParallelRegex($this->_case); |
| 267 | 267 | } |
| 268 | 268 | $this->_regexes[$mode]->addPattern($pattern, "__exit"); |
| 269 | - if (! isset($this->_mode_handlers[$mode])) { |
|
| 269 | + if (!isset($this->_mode_handlers[$mode])) { |
|
| 270 | 270 | $this->_mode_handlers[$mode] = $mode; |
| 271 | 271 | } |
| 272 | 272 | } |
@@ -284,11 +284,11 @@ discard block |
||
| 284 | 284 | * @access public |
| 285 | 285 | */ |
| 286 | 286 | function addSpecialPattern($pattern, $mode, $special) { |
| 287 | - if (! isset($this->_regexes[$mode])) { |
|
| 287 | + if (!isset($this->_regexes[$mode])) { |
|
| 288 | 288 | $this->_regexes[$mode] = new ParallelRegex($this->_case); |
| 289 | 289 | } |
| 290 | 290 | $this->_regexes[$mode]->addPattern($pattern, "_$special"); |
| 291 | - if (! isset($this->_mode_handlers[$special])) { |
|
| 291 | + if (!isset($this->_mode_handlers[$special])) { |
|
| 292 | 292 | $this->_mode_handlers[$special] = $special; |
| 293 | 293 | } |
| 294 | 294 | } |
@@ -314,13 +314,13 @@ discard block |
||
| 314 | 314 | * @access public |
| 315 | 315 | */ |
| 316 | 316 | function parse($raw) { |
| 317 | - if (! isset($this->_parser)) { |
|
| 317 | + if (!isset($this->_parser)) { |
|
| 318 | 318 | return false; |
| 319 | 319 | } |
| 320 | 320 | $length = strlen($raw); |
| 321 | 321 | while (is_array($parsed = $this->_reduce($raw))) { |
| 322 | 322 | list($raw, $unmatched, $matched, $mode) = $parsed; |
| 323 | - if (! $this->_dispatchTokens($unmatched, $matched, $mode)) { |
|
| 323 | + if (!$this->_dispatchTokens($unmatched, $matched, $mode)) { |
|
| 324 | 324 | return false; |
| 325 | 325 | } |
| 326 | 326 | if ($raw === '') { |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | } |
| 332 | 332 | $length = strlen($raw); |
| 333 | 333 | } |
| 334 | - if (! $parsed) { |
|
| 334 | + if (!$parsed) { |
|
| 335 | 335 | return false; |
| 336 | 336 | } |
| 337 | 337 | return $this->_invokeParser($raw, LEXER_UNMATCHED); |
@@ -350,21 +350,21 @@ discard block |
||
| 350 | 350 | * @access private |
| 351 | 351 | */ |
| 352 | 352 | function _dispatchTokens($unmatched, $matched, $mode = false) { |
| 353 | - if (! $this->_invokeParser($unmatched, LEXER_UNMATCHED)) { |
|
| 353 | + if (!$this->_invokeParser($unmatched, LEXER_UNMATCHED)) { |
|
| 354 | 354 | return false; |
| 355 | 355 | } |
| 356 | 356 | if (is_bool($mode)) { |
| 357 | 357 | return $this->_invokeParser($matched, LEXER_MATCHED); |
| 358 | 358 | } |
| 359 | 359 | if ($this->_isModeEnd($mode)) { |
| 360 | - if (! $this->_invokeParser($matched, LEXER_EXIT)) { |
|
| 360 | + if (!$this->_invokeParser($matched, LEXER_EXIT)) { |
|
| 361 | 361 | return false; |
| 362 | 362 | } |
| 363 | 363 | return $this->_mode->leave(); |
| 364 | 364 | } |
| 365 | 365 | if ($this->_isSpecialMode($mode)) { |
| 366 | 366 | $this->_mode->enter($this->_decodeSpecial($mode)); |
| 367 | - if (! $this->_invokeParser($matched, LEXER_SPECIAL)) { |
|
| 367 | + if (!$this->_invokeParser($matched, LEXER_SPECIAL)) { |
|
| 368 | 368 | return false; |
| 369 | 369 | } |
| 370 | 370 | return $this->_mode->leave(); |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | * @access public |
| 632 | 632 | */ |
| 633 | 633 | function acceptEndToken($token, $event) { |
| 634 | - if (! preg_match('/<\/(.*)>/', $token, $matches)) { |
|
| 634 | + if (!preg_match('/<\/(.*)>/', $token, $matches)) { |
|
| 635 | 635 | return false; |
| 636 | 636 | } |
| 637 | 637 | return $this->_listener->endElement(strtolower($matches[1])); |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | } |
| 652 | 652 | if ($event == LEXER_SPECIAL) { |
| 653 | 653 | $this->_attributes[$this->_current_attribute] .= |
| 654 | - preg_replace('/^=\s*/' , '', SimpleHtmlSaxParser::decodeHtml($token)); |
|
| 654 | + preg_replace('/^=\s*/', '', SimpleHtmlSaxParser::decodeHtml($token)); |
|
| 655 | 655 | } |
| 656 | 656 | return true; |
| 657 | 657 | } |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | */ |
| 699 | 699 | static function decodeHtml($html) { |
| 700 | 700 | static $translations; |
| 701 | - if (! isset($translations)) { |
|
| 701 | + if (!isset($translations)) { |
|
| 702 | 702 | $translations = array_flip(get_html_translation_table(HTML_ENTITIES)); |
| 703 | 703 | } |
| 704 | 704 | return strtr($html, $translations); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | require_once(dirname(__FILE__) . '/scorer.php'); |
| 16 | 16 | require_once(dirname(__FILE__) . '/expectation.php'); |
| 17 | 17 | require_once(dirname(__FILE__) . '/dumper.php'); |
| 18 | - if (! defined('SIMPLE_TEST')) { |
|
| 18 | + if (!defined('SIMPLE_TEST')) { |
|
| 19 | 19 | define('SIMPLE_TEST', dirname(__FILE__) . '/'); |
| 20 | 20 | } |
| 21 | 21 | /**#@-*/ |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @access private |
| 56 | 56 | */ |
| 57 | 57 | function _atBeginning() { |
| 58 | - return ($this->_position == 0) && ! $this->_isEmpty(); |
|
| 58 | + return ($this->_position == 0) && !$this->_isEmpty(); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @access private |
| 65 | 65 | */ |
| 66 | 66 | function _atEnd() { |
| 67 | - return ($this->_position + 1 >= count($this->_sequence)) && ! $this->_isEmpty(); |
|
| 67 | + return ($this->_position + 1 >= count($this->_sequence)) && !$this->_isEmpty(); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | if ($this->_isEmpty()) { |
| 145 | 145 | return; |
| 146 | 146 | } |
| 147 | - while (! $this->_atEnd()) { |
|
| 147 | + while (!$this->_atEnd()) { |
|
| 148 | 148 | array_pop($this->_sequence); |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | function &_parse($response, $depth = 0) { |
| 249 | 249 | $page = $this->_buildPage($response); |
| 250 | - if ($this->_ignore_frames || ! $page->hasFrames() || ($depth > $this->_maximum_nested_frames)) { |
|
| 250 | + if ($this->_ignore_frames || !$page->hasFrames() || ($depth > $this->_maximum_nested_frames)) { |
|
| 251 | 251 | return $page; |
| 252 | 252 | } |
| 253 | 253 | $frameset = new SimpleFrameset($page); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | function _load($url, $parameters) { |
| 305 | 305 | $frame = $url->getTarget(); |
| 306 | - if (! $frame || ! $this->_page->hasFrames() || (strtolower($frame) == '_top')) { |
|
| 306 | + if (!$frame || !$this->_page->hasFrames() || (strtolower($frame) == '_top')) { |
|
| 307 | 307 | return $this->_loadPage($url, $parameters); |
| 308 | 308 | } |
| 309 | 309 | return $this->_loadFrame(array($frame), $url, $parameters); |
@@ -460,14 +460,14 @@ discard block |
||
| 460 | 460 | * @access public |
| 461 | 461 | */ |
| 462 | 462 | function head($url, $parameters = false) { |
| 463 | - if (! is_object($url)) { |
|
| 463 | + if (!is_object($url)) { |
|
| 464 | 464 | $url = new SimpleUrl($url); |
| 465 | 465 | } |
| 466 | 466 | if ($this->getUrl()) { |
| 467 | 467 | $url = $url->makeAbsolute($this->getUrl()); |
| 468 | 468 | } |
| 469 | 469 | $response = $this->_user_agent->fetchResponse($url, new SimpleHeadEncoding($parameters)); |
| 470 | - return ! $response->isError(); |
|
| 470 | + return !$response->isError(); |
|
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | /** |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | * @access public |
| 480 | 480 | */ |
| 481 | 481 | function get($url, $parameters = false) { |
| 482 | - if (! is_object($url)) { |
|
| 482 | + if (!is_object($url)) { |
|
| 483 | 483 | $url = new SimpleUrl($url); |
| 484 | 484 | } |
| 485 | 485 | if ($this->getUrl()) { |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | * @access public |
| 497 | 497 | */ |
| 498 | 498 | function post($url, $parameters = false) { |
| 499 | - if (! is_object($url)) { |
|
| 499 | + if (!is_object($url)) { |
|
| 500 | 500 | $url = new SimpleUrl($url); |
| 501 | 501 | } |
| 502 | 502 | if ($this->getUrl()) { |
@@ -539,11 +539,11 @@ discard block |
||
| 539 | 539 | * @access public |
| 540 | 540 | */ |
| 541 | 541 | function back() { |
| 542 | - if (! $this->_history->back()) { |
|
| 542 | + if (!$this->_history->back()) { |
|
| 543 | 543 | return false; |
| 544 | 544 | } |
| 545 | 545 | $content = $this->retry(); |
| 546 | - if (! $content) { |
|
| 546 | + if (!$content) { |
|
| 547 | 547 | $this->_history->forward(); |
| 548 | 548 | } |
| 549 | 549 | return $content; |
@@ -559,11 +559,11 @@ discard block |
||
| 559 | 559 | * @access public |
| 560 | 560 | */ |
| 561 | 561 | function forward() { |
| 562 | - if (! $this->_history->forward()) { |
|
| 562 | + if (!$this->_history->forward()) { |
|
| 563 | 563 | return false; |
| 564 | 564 | } |
| 565 | 565 | $content = $this->retry(); |
| 566 | - if (! $content) { |
|
| 566 | + if (!$content) { |
|
| 567 | 567 | $this->_history->back(); |
| 568 | 568 | } |
| 569 | 569 | return $content; |
@@ -580,11 +580,11 @@ discard block |
||
| 580 | 580 | * @access public |
| 581 | 581 | */ |
| 582 | 582 | function authenticate($username, $password) { |
| 583 | - if (! $this->_page->getRealm()) { |
|
| 583 | + if (!$this->_page->getRealm()) { |
|
| 584 | 584 | return false; |
| 585 | 585 | } |
| 586 | 586 | $url = $this->_page->getUrl(); |
| 587 | - if (! $url) { |
|
| 587 | + if (!$url) { |
|
| 588 | 588 | return false; |
| 589 | 589 | } |
| 590 | 590 | $this->_user_agent->setIdentity( |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | * @access public |
| 851 | 851 | */ |
| 852 | 852 | function clickSubmit($label = 'Submit', $additional = false) { |
| 853 | - if (! ($form = $this->_page->getFormBySubmit(new SimpleByLabel($label)))) { |
|
| 853 | + if (!($form = $this->_page->getFormBySubmit(new SimpleByLabel($label)))) { |
|
| 854 | 854 | return false; |
| 855 | 855 | } |
| 856 | 856 | $success = $this->_load( |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | * @access public |
| 869 | 869 | */ |
| 870 | 870 | function clickSubmitByName($name, $additional = false) { |
| 871 | - if (! ($form = $this->_page->getFormBySubmit(new SimpleByName($name)))) { |
|
| 871 | + if (!($form = $this->_page->getFormBySubmit(new SimpleByName($name)))) { |
|
| 872 | 872 | return false; |
| 873 | 873 | } |
| 874 | 874 | $success = $this->_load( |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | * @access public |
| 887 | 887 | */ |
| 888 | 888 | function clickSubmitById($id, $additional = false) { |
| 889 | - if (! ($form = $this->_page->getFormBySubmit(new SimpleById($id)))) { |
|
| 889 | + if (!($form = $this->_page->getFormBySubmit(new SimpleById($id)))) { |
|
| 890 | 890 | return false; |
| 891 | 891 | } |
| 892 | 892 | $success = $this->_load( |
@@ -909,7 +909,7 @@ discard block |
||
| 909 | 909 | * @access public |
| 910 | 910 | */ |
| 911 | 911 | function clickImage($label, $x = 1, $y = 1, $additional = false) { |
| 912 | - if (! ($form = $this->_page->getFormByImage(new SimpleByLabel($label)))) { |
|
| 912 | + if (!($form = $this->_page->getFormByImage(new SimpleByLabel($label)))) { |
|
| 913 | 913 | return false; |
| 914 | 914 | } |
| 915 | 915 | $success = $this->_load( |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | * @access public |
| 933 | 933 | */ |
| 934 | 934 | function clickImageByName($name, $x = 1, $y = 1, $additional = false) { |
| 935 | - if (! ($form = $this->_page->getFormByImage(new SimpleByName($name)))) { |
|
| 935 | + if (!($form = $this->_page->getFormByImage(new SimpleByName($name)))) { |
|
| 936 | 936 | return false; |
| 937 | 937 | } |
| 938 | 938 | $success = $this->_load( |
@@ -954,7 +954,7 @@ discard block |
||
| 954 | 954 | * @access public |
| 955 | 955 | */ |
| 956 | 956 | function clickImageById($id, $x = 1, $y = 1, $additional = false) { |
| 957 | - if (! ($form = $this->_page->getFormByImage(new SimpleById($id)))) { |
|
| 957 | + if (!($form = $this->_page->getFormByImage(new SimpleById($id)))) { |
|
| 958 | 958 | return false; |
| 959 | 959 | } |
| 960 | 960 | $success = $this->_load( |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | * @access public |
| 972 | 972 | */ |
| 973 | 973 | function submitFormById($id) { |
| 974 | - if (! ($form = $this->_page->getFormById($id))) { |
|
| 974 | + if (!($form = $this->_page->getFormById($id))) { |
|
| 975 | 975 | return false; |
| 976 | 976 | } |
| 977 | 977 | $success = $this->_load( |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | * @access public |
| 1020 | 1020 | */ |
| 1021 | 1021 | function clickLinkById($id) { |
| 1022 | - if (! ($url = $this->_page->getUrlById($id))) { |
|
| 1022 | + if (!($url = $this->_page->getUrlById($id))) { |
|
| 1023 | 1023 | return false; |
| 1024 | 1024 | } |
| 1025 | 1025 | $this->_load($url, new SimpleGetEncoding()); |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | * @access public |
| 1034 | 1034 | */ |
| 1035 | 1035 | function isLinkById($id) { |
| 1036 | - return (boolean)$this->_page->getUrlById($id); |
|
| 1036 | + return (boolean) $this->_page->getUrlById($id); |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | /** |
@@ -1045,10 +1045,10 @@ discard block |
||
| 1045 | 1045 | */ |
| 1046 | 1046 | function click($label) { |
| 1047 | 1047 | $raw = $this->clickSubmit($label); |
| 1048 | - if (! $raw) { |
|
| 1048 | + if (!$raw) { |
|
| 1049 | 1049 | $raw = $this->clickLink($label); |
| 1050 | 1050 | } |
| 1051 | - if (! $raw) { |
|
| 1051 | + if (!$raw) { |
|
| 1052 | 1052 | $raw = $this->clickImage($label); |
| 1053 | 1053 | } |
| 1054 | 1054 | return $raw; |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | * @access public |
| 65 | 65 | */ |
| 66 | 66 | function isMatch($widget) { |
| 67 | - if (! method_exists($widget, 'isLabel')) { |
|
| 67 | + if (!method_exists($widget, 'isLabel')) { |
|
| 68 | 68 | return false; |
| 69 | 69 | } |
| 70 | 70 | return $widget->isLabel($this->_label); |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | - static $baseurl='http://127.0.0.1/prado-master/tests/FunctionalTests/'; |
|
| 48 | + static $baseurl = 'http://127.0.0.1/prado-master/tests/FunctionalTests/'; |
|
| 49 | 49 | |
| 50 | - static $timeout=5; //seconds |
|
| 50 | + static $timeout = 5; //seconds |
|
| 51 | 51 | |
| 52 | 52 | protected function setUp() |
| 53 | 53 | { |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | list($id, $attr) = explode('@', $idattr); |
| 62 | 62 | |
| 63 | 63 | $element = $this->getElement($id); |
| 64 | - $value=$element->attribute($attr); |
|
| 64 | + $value = $element->attribute($attr); |
|
| 65 | 65 | |
| 66 | - if(strpos($txt, 'regexp:')===0) |
|
| 66 | + if (strpos($txt, 'regexp:') === 0) |
|
| 67 | 67 | { |
| 68 | - $this->assertRegExp('/'.substr($txt, 7).'/', $value); |
|
| 68 | + $this->assertRegExp('/' . substr($txt, 7) . '/', $value); |
|
| 69 | 69 | } else { |
| 70 | 70 | $this->assertEquals($txt, $value); |
| 71 | 71 | } |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | protected function getElement($id) |
| 75 | 75 | { |
| 76 | - if(strpos($id, 'id=')===0) { |
|
| 76 | + if (strpos($id, 'id=') === 0) { |
|
| 77 | 77 | return $this->byId(substr($id, 3)); |
| 78 | - } elseif(strpos($id, 'name=')===0) { |
|
| 78 | + } elseif (strpos($id, 'name=') === 0) { |
|
| 79 | 79 | return $this->byName(substr($id, 5)); |
| 80 | - } elseif(strpos($id, '//')===0) { |
|
| 80 | + } elseif (strpos($id, '//') === 0) { |
|
| 81 | 81 | return $this->byXPath($id); |
| 82 | - } elseif(strpos($id, '$')!==false) { |
|
| 82 | + } elseif (strpos($id, '$') !== false) { |
|
| 83 | 83 | return $this->byName($id); |
| 84 | 84 | } else { |
| 85 | 85 | return $this->byId($id); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | protected function assertValue($id, $txt) |
| 95 | 95 | { |
| 96 | - try{ |
|
| 96 | + try { |
|
| 97 | 97 | $this->assertEquals($txt, $this->getElement($id)->value()); |
| 98 | 98 | } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { |
| 99 | 99 | //stale element reference. try second time. |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | protected function assertVisible($id) |
| 106 | 106 | { |
| 107 | - try{ |
|
| 107 | + try { |
|
| 108 | 108 | $this->assertTrue($this->getElement($id)->displayed()); |
| 109 | 109 | } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { |
| 110 | 110 | //stale element reference. try second time. |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | protected function assertNotVisible($id) |
| 117 | 117 | { |
| 118 | - try{ |
|
| 118 | + try { |
|
| 119 | 119 | $this->assertFalse($this->getElement($id)->displayed()); |
| 120 | 120 | } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { |
| 121 | 121 | //stale element reference. try second time. |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | protected function assertElementPresent($id) |
| 128 | 128 | { |
| 129 | - $this->assertTrue($this->getElement($id)!==null); |
|
| 129 | + $this->assertTrue($this->getElement($id) !== null); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | protected function assertElementNotPresent($id) |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoSuchElement, $e->getCode()); |
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | - $this->fail('The element '.$id.' shouldn\'t exist.'); |
|
| 140 | + $this->fail('The element ' . $id . ' shouldn\'t exist.'); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - protected function type($id, $txt='') |
|
| 143 | + protected function type($id, $txt = '') |
|
| 144 | 144 | { |
| 145 | 145 | $element = $this->getElement($id); |
| 146 | 146 | $element->clear(); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $this->byCssSelector('body')->click(); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - protected function typeSpecial($id, $txt='') |
|
| 152 | + protected function typeSpecial($id, $txt = '') |
|
| 153 | 153 | { |
| 154 | 154 | $element = $this->getElement($id); |
| 155 | 155 | // clear the textbox without using clear() that triggers onchange() |
@@ -159,16 +159,16 @@ discard block |
||
| 159 | 159 | // sequences of end+backspace and start+delete |
| 160 | 160 | |
| 161 | 161 | $element->click(); |
| 162 | - while(strlen($element->value())>0) |
|
| 162 | + while (strlen($element->value()) > 0) |
|
| 163 | 163 | { |
| 164 | 164 | $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::END); |
| 165 | 165 | // the number 100 is purely empiric |
| 166 | - for($i=0;$i<100;$i++) |
|
| 166 | + for ($i = 0; $i < 100; $i++) |
|
| 167 | 167 | $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::BACKSPACE); |
| 168 | 168 | |
| 169 | 169 | $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::HOME); |
| 170 | 170 | // the number 100 is purely empiric |
| 171 | - for($i=0;$i<100;$i++) |
|
| 171 | + for ($i = 0; $i < 100; $i++) |
|
| 172 | 172 | $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::DELETE); |
| 173 | 173 | } |
| 174 | 174 | |
@@ -207,20 +207,20 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | protected function assertSelectedIndex($id, $value) |
| 209 | 209 | { |
| 210 | - $options=parent::select($this->getElement($id))->selectOptionValues(); |
|
| 211 | - $curval=parent::select($this->getElement($id))->selectedValue(); |
|
| 210 | + $options = parent::select($this->getElement($id))->selectOptionValues(); |
|
| 211 | + $curval = parent::select($this->getElement($id))->selectedValue(); |
|
| 212 | 212 | |
| 213 | - $i=0; |
|
| 214 | - foreach($options as $option) |
|
| 213 | + $i = 0; |
|
| 214 | + foreach ($options as $option) |
|
| 215 | 215 | { |
| 216 | - if($option==$curval) |
|
| 216 | + if ($option == $curval) |
|
| 217 | 217 | { |
| 218 | 218 | $this->assertEquals($i, $value); |
| 219 | 219 | return; |
| 220 | 220 | } |
| 221 | 221 | $i++; |
| 222 | 222 | } |
| 223 | - $this->fail('Current value '.$curval.' not found in: '.implode(',', $options)); |
|
| 223 | + $this->fail('Current value ' . $curval . ' not found in: ' . implode(',', $options)); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | protected function assertSelected($id, $label) |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | protected function assertAlertNotPresent() |
| 242 | 242 | { |
| 243 | 243 | try { |
| 244 | - $foo=$this->alertText(); |
|
| 244 | + $foo = $this->alertText(); |
|
| 245 | 245 | } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { |
| 246 | 246 | $this->assertEquals(PHPUnit_Extensions_Selenium2TestCase_WebDriverException::NoAlertOpenError, $e->getCode()); |
| 247 | 247 | return; |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | protected function pause($msec) |
| 253 | 253 | { |
| 254 | - usleep($msec*1000); |
|
| 254 | + usleep($msec * 1000); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | public function assertSourceContains($text) |
| 258 | 258 | { |
| 259 | 259 | $found = strpos($this->source(), $text) !== false; |
| 260 | - for($i=0;$i<10 && ! $found; $i++) { |
|
| 260 | + for ($i = 0; $i < 10 && !$found; $i++) { |
|
| 261 | 261 | $this->pause(20); |
| 262 | 262 | $found = strpos($this->source(), $text) !== false; |
| 263 | 263 | } |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | public function assertSourceNotContains($text) |
| 268 | 268 | { |
| 269 | 269 | $found = strpos($this->source(), $text) !== false; |
| 270 | - for($i=0;$i<10 && $found; $i++) { |
|
| 270 | + for ($i = 0; $i < 10 && $found; $i++) { |
|
| 271 | 271 | $this->pause(20); |
| 272 | 272 | $found = strpos($this->source(), $text) !== false; |
| 273 | 273 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function setText($value) { |
| 23 | - $this->_text=$value; |
|
| 23 | + $this->_text = $value; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public function getReadOnlyProperty() { |
@@ -32,22 +32,22 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function getObject() { |
| 35 | - if(!$this->_object) { |
|
| 36 | - $this->_object=new NewComponent; |
|
| 37 | - $this->_object->_text='object text'; |
|
| 35 | + if (!$this->_object) { |
|
| 36 | + $this->_object = new NewComponent; |
|
| 37 | + $this->_object->_text = 'object text'; |
|
| 38 | 38 | } |
| 39 | 39 | return $this->_object; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function onMyEvent($param) { |
| 43 | - $this->raiseEvent('OnMyEvent',$this,$param); |
|
| 43 | + $this->raiseEvent('OnMyEvent', $this, $param); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - public function myEventHandler($sender,$param) { |
|
| 47 | - $this->_eventHandled=true; |
|
| 46 | + public function myEventHandler($sender, $param) { |
|
| 47 | + $this->_eventHandled = true; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - public function eventReturnValue($sender,$param) { |
|
| 50 | + public function eventReturnValue($sender, $param) { |
|
| 51 | 51 | return $param->Return; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -95,22 +95,22 @@ discard block |
||
| 95 | 95 | return $this->_callorder; |
| 96 | 96 | } |
| 97 | 97 | public function __dycall($method, $args) { |
| 98 | - if(strncasecmp($method,'fx',2)!==0) return; |
|
| 98 | + if (strncasecmp($method, 'fx', 2) !== 0) return; |
|
| 99 | 99 | $this->_callorder[] = 'fxcall'; |
| 100 | 100 | } |
| 101 | - public function fxGlobalListener($sender,$param,$name) { |
|
| 101 | + public function fxGlobalListener($sender, $param, $name) { |
|
| 102 | 102 | $this->_callorder[] = 'fxGL'; |
| 103 | 103 | } |
| 104 | - public function fxPrimaryGlobalEvent($sender,$param,$name) { |
|
| 104 | + public function fxPrimaryGlobalEvent($sender, $param, $name) { |
|
| 105 | 105 | $this->_callorder[] = 'primary'; |
| 106 | 106 | } |
| 107 | - public function commonRaiseEventListener($sender,$param,$name) { |
|
| 107 | + public function commonRaiseEventListener($sender, $param, $name) { |
|
| 108 | 108 | $this->_callorder[] = 'com'; |
| 109 | 109 | } |
| 110 | - public function postglobalRaiseEventListener($sender,$param,$name) { |
|
| 110 | + public function postglobalRaiseEventListener($sender, $param, $name) { |
|
| 111 | 111 | $this->_callorder[] = 'postgl'; |
| 112 | 112 | } |
| 113 | - public function preglobalRaiseEventListener($sender,$param,$name) { |
|
| 113 | + public function preglobalRaiseEventListener($sender, $param, $name) { |
|
| 114 | 114 | $this->_callorder[] = 'pregl'; |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $this->_baseObject = $object; |
| 124 | 124 | return $laa * $sol; |
| 125 | 125 | } |
| 126 | - public function getLastClassObject() {return $this->_baseObject;} |
|
| 126 | + public function getLastClassObject() {return $this->_baseObject; } |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | class FooFooClassBehavior extends FooClassBehavior { |
@@ -164,10 +164,10 @@ discard block |
||
| 164 | 164 | private $_instanceReturn = null; |
| 165 | 165 | |
| 166 | 166 | public function moreFunction($laa, $sol) { |
| 167 | - return pow($laa+$sol+1, 2); |
|
| 167 | + return pow($laa + $sol + 1, 2); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - public function isinstanceof($class, $instance=null) { |
|
| 170 | + public function isinstanceof($class, $instance = null) { |
|
| 171 | 171 | return $this->_instanceReturn; |
| 172 | 172 | } |
| 173 | 173 | public function setInstanceReturn($value) { |
@@ -176,14 +176,14 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | class DynamicCallComponent extends NewComponent implements IDynamicMethods { |
| 178 | 178 | public function __dycall($method, $args) { |
| 179 | - if($method === 'dyPowerFunction') |
|
| 179 | + if ($method === 'dyPowerFunction') |
|
| 180 | 180 | return pow($args[0], $args[1]); |
| 181 | - if($method === 'dyDivisionFunction') |
|
| 181 | + if ($method === 'dyDivisionFunction') |
|
| 182 | 182 | return $args[0] / $args[1]; |
| 183 | - if($method === 'fxPowerFunction') |
|
| 184 | - return 2*pow($args[0], $args[1]); |
|
| 185 | - if($method === 'fxDivisionFunction') |
|
| 186 | - return 2*$args[0] / $args[1]; |
|
| 183 | + if ($method === 'fxPowerFunction') |
|
| 184 | + return 2 * pow($args[0], $args[1]); |
|
| 185 | + if ($method === 'fxDivisionFunction') |
|
| 186 | + return 2 * $args[0] / $args[1]; |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
@@ -201,8 +201,8 @@ discard block |
||
| 201 | 201 | return true; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - public function onBehaviorEvent($sender, $param,$responsetype=null,$postfunction=null) { |
|
| 205 | - return $this->getOwner()->raiseEvent('onBehaviorEvent',$sender,$param,$responsetype,$postfunction); |
|
| 204 | + public function onBehaviorEvent($sender, $param, $responsetype = null, $postfunction = null) { |
|
| 205 | + return $this->getOwner()->raiseEvent('onBehaviorEvent', $sender, $param, $responsetype, $postfunction); |
|
| 206 | 206 | } |
| 207 | 207 | public function fxGlobalBehaviorEvent($sender, $param) { |
| 208 | 208 | } |
@@ -294,22 +294,22 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | return $chain->dyUnlisten($fx); |
| 296 | 296 | } |
| 297 | - public function dyPreRaiseEvent($name,$sender,$param,$responsetype,$postfunction, $chain) { |
|
| 297 | + public function dyPreRaiseEvent($name, $sender, $param, $responsetype, $postfunction, $chain) { |
|
| 298 | 298 | $this->lastCall = 3; |
| 299 | 299 | $this->arglist = func_get_args(); |
| 300 | 300 | |
| 301 | - return $chain->dyPreRaiseEvent($name);// Calls the next event, within a chain, if parameters are left off, they are filled in with |
|
| 301 | + return $chain->dyPreRaiseEvent($name); // Calls the next event, within a chain, if parameters are left off, they are filled in with |
|
| 302 | 302 | // the original parameters passed to the dynamic event. Parameters can be passed if they are changed. |
| 303 | 303 | } |
| 304 | - public function dyIntraRaiseEventTestHandler($handler,$sender,$param,$name, $chain) { |
|
| 304 | + public function dyIntraRaiseEventTestHandler($handler, $sender, $param, $name, $chain) { |
|
| 305 | 305 | $this->lastCall += 4; |
| 306 | 306 | $this->arglist = func_get_args(); |
| 307 | 307 | } |
| 308 | - public function dyIntraRaiseEventPostHandler($name,$sender,$param,$handler, $chain) { |
|
| 308 | + public function dyIntraRaiseEventPostHandler($name, $sender, $param, $handler, $chain) { |
|
| 309 | 309 | $this->lastCall += 5; |
| 310 | 310 | $this->arglist = func_get_args(); |
| 311 | 311 | } |
| 312 | - public function dyPostRaiseEvent($responses,$name,$sender,$param,$responsetype,$postfunction, $chain) { |
|
| 312 | + public function dyPostRaiseEvent($responses, $name, $sender, $param, $responsetype, $postfunction, $chain) { |
|
| 313 | 313 | $this->lastCall += 6; |
| 314 | 314 | $this->arglist = func_get_args(); |
| 315 | 315 | } |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | $this->lastCall = 10; |
| 333 | 333 | $this->arglist = func_get_args(); |
| 334 | 334 | } |
| 335 | - public function dyAttachBehavior($name,$behavior, $chain) { |
|
| 335 | + public function dyAttachBehavior($name, $behavior, $chain) { |
|
| 336 | 336 | $this->lastCall = 11; |
| 337 | 337 | $this->arglist = func_get_args(); |
| 338 | 338 | } |
| 339 | - public function dyDetachBehavior($name,$behavior, $chain) { |
|
| 339 | + public function dyDetachBehavior($name, $behavior, $chain) { |
|
| 340 | 340 | $this->lastCall = 12; |
| 341 | 341 | $this->arglist = func_get_args(); |
| 342 | 342 | } |
@@ -348,11 +348,11 @@ discard block |
||
| 348 | 348 | $this->lastCall = 14; |
| 349 | 349 | $this->arglist = func_get_args(); |
| 350 | 350 | } |
| 351 | - public function dyEnableBehavior($name,$behavior, $chain) { |
|
| 351 | + public function dyEnableBehavior($name, $behavior, $chain) { |
|
| 352 | 352 | $this->lastCall = 15; |
| 353 | 353 | $this->arglist = func_get_args(); |
| 354 | 354 | } |
| 355 | - public function dyDisableBehavior($name,$behavior, $chain) { |
|
| 355 | + public function dyDisableBehavior($name, $behavior, $chain) { |
|
| 356 | 356 | $this->lastCall = 16; |
| 357 | 357 | $this->arglist = func_get_args(); |
| 358 | 358 | } |
@@ -370,11 +370,11 @@ discard block |
||
| 370 | 370 | } |
| 371 | 371 | public function __dycall($method, $args) { |
| 372 | 372 | $this->_dyMethod = $method; |
| 373 | - if($method == 'dyTestDynamicBehaviorMethod') |
|
| 373 | + if ($method == 'dyTestDynamicBehaviorMethod') |
|
| 374 | 374 | return $args[0] / $args[1]; |
| 375 | 375 | } |
| 376 | 376 | public function dyTestIntraEvent($param1, $param2, $chain) { |
| 377 | - return $chain->dyTestIntraEvent($param1*2*$param2, $param2); |
|
| 377 | + return $chain->dyTestIntraEvent($param1 * 2 * $param2, $param2); |
|
| 378 | 378 | } |
| 379 | 379 | public function TestBehaviorMethod($param1, $param2) { |
| 380 | 380 | return $param1 * $param2; |
@@ -391,11 +391,11 @@ discard block |
||
| 391 | 391 | public function __dycall($method, $args) { |
| 392 | 392 | $this->_dyMethod = $method; |
| 393 | 393 | $object = array_shift($args); |
| 394 | - if($method == 'dyTestDynamicClassBehaviorMethod') |
|
| 394 | + if ($method == 'dyTestDynamicClassBehaviorMethod') |
|
| 395 | 395 | return $args[0] / $args[1]; |
| 396 | 396 | } |
| 397 | 397 | public function dyTestIntraEvent($object, $param1, $param2, $chain) { |
| 398 | - return $chain->dyTestIntraEvent($param1*2*$param2, $param2); |
|
| 398 | + return $chain->dyTestIntraEvent($param1 * 2 * $param2, $param2); |
|
| 399 | 399 | } |
| 400 | 400 | public function TestBehaviorMethod($object, $param1, $param2) { |
| 401 | 401 | return $param1 * $param2; |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | public function tearDown() { |
| 421 | 421 | // PHP version 5.3.6 doesn't call the __destruct method when unsetting variables; |
| 422 | 422 | // Thus any object that listens must be explicitly call unlisten in this version of PHP. |
| 423 | - if($this->component) |
|
| 423 | + if ($this->component) |
|
| 424 | 424 | $this->component->unlisten(); |
| 425 | 425 | $this->component = null; |
| 426 | 426 | } |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | $this->assertEquals(25, $component->Bar->moreFunction(2, 2)); |
| 462 | 462 | $this->assertEquals(8, $component->FooBar->moreFunction(2, 2)); |
| 463 | 463 | |
| 464 | - $component->unlisten();// unwind object and class behaviors |
|
| 464 | + $component->unlisten(); // unwind object and class behaviors |
|
| 465 | 465 | $this->component->detachClassBehavior('FooBar', 'NewComponent'); |
| 466 | 466 | $this->component->detachClassBehavior('Bar', 'NewComponentNoListen'); |
| 467 | 467 | |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | try { |
| 546 | 546 | $this->component->attachClassBehavior('FooClassBehavior', new BarClassBehavior); |
| 547 | 547 | $this->fail('TInvalidOperationException not raised when overwriting an existing behavior'); |
| 548 | - } catch(TInvalidOperationException $e) { |
|
| 548 | + } catch (TInvalidOperationException $e) { |
|
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | try { |
| 554 | 554 | $this->component->attachClassBehavior('FooBarBehavior', 'FooBarBehavior', 'TComponent'); |
| 555 | 555 | $this->fail('TInvalidOperationException not raised when trying to place a behavior on the root object TComponent'); |
| 556 | - } catch(TInvalidOperationException $e) { |
|
| 556 | + } catch (TInvalidOperationException $e) { |
|
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | try { |
| 816 | 816 | $this->component->faaEverMore(true, true); |
| 817 | 817 | $this->fail('TApplicationException not raised trying to execute a undefined class method'); |
| 818 | - } catch(TApplicationException $e) {} |
|
| 818 | + } catch (TApplicationException $e) {} |
|
| 819 | 819 | |
| 820 | 820 | $this->assertNull($this->component->asa('FooBehavior')); |
| 821 | 821 | $this->assertFalse($this->component->isa('FooBehavior')); |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | try { |
| 826 | 826 | $this->component->attachBehavior('FooBehavior', new TComponent); |
| 827 | 827 | $this->fail('TApplicationException not raised trying to execute a undefined class method'); |
| 828 | - } catch(TInvalidDataTypeException $e) {} |
|
| 828 | + } catch (TInvalidDataTypeException $e) {} |
|
| 829 | 829 | |
| 830 | 830 | $this->component->attachBehavior('FooBehavior', new FooBehavior); |
| 831 | 831 | |
@@ -836,14 +836,14 @@ discard block |
||
| 836 | 836 | |
| 837 | 837 | try { |
| 838 | 838 | $this->assertTrue($this->component->faaEverMore(true, true)); |
| 839 | - } catch(TApplicationException $e) { |
|
| 839 | + } catch (TApplicationException $e) { |
|
| 840 | 840 | $this->fail('TApplicationException raised while trying to execute a behavior class method'); |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | try { |
| 844 | 844 | $this->component->noMethodHere(true); |
| 845 | 845 | $this->fail('TApplicationException not raised trying to execute a undefined class method'); |
| 846 | - } catch(TApplicationException $e) {} |
|
| 846 | + } catch (TApplicationException $e) {} |
|
| 847 | 847 | |
| 848 | 848 | $this->assertTrue($this->component->disableBehavior('FooBehavior')); |
| 849 | 849 | |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | try { |
| 854 | 854 | $this->component->faaEverMore(true, true); |
| 855 | 855 | $this->fail('TApplicationException not raised trying to execute a undefined class method'); |
| 856 | - } catch(TApplicationException $e) {} |
|
| 856 | + } catch (TApplicationException $e) {} |
|
| 857 | 857 | |
| 858 | 858 | $this->assertTrue($this->component->enableBehavior('FooBehavior')); |
| 859 | 859 | |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | |
| 863 | 863 | try { |
| 864 | 864 | $this->assertTrue($this->component->faaEverMore(true, true)); |
| 865 | - } catch(TApplicationException $e) { |
|
| 865 | + } catch (TApplicationException $e) { |
|
| 866 | 866 | $this->fail('TApplicationException raised while trying to execute a behavior class method'); |
| 867 | 867 | } |
| 868 | 868 | |
@@ -962,14 +962,14 @@ discard block |
||
| 962 | 962 | try { |
| 963 | 963 | $this->component->faaEverMore(true, true); |
| 964 | 964 | $this->fail('TApplicationException not raised trying to execute a undefined class method'); |
| 965 | - } catch(TApplicationException $e) {} |
|
| 965 | + } catch (TApplicationException $e) {} |
|
| 966 | 966 | |
| 967 | 967 | $this->component->attachBehavior('FooBehavior', new FooBehavior); |
| 968 | 968 | |
| 969 | 969 | $this->assertTrue($this->component->isa('FooBehavior')); |
| 970 | 970 | try { |
| 971 | 971 | $this->assertTrue($this->component->faaEverMore(true, true)); |
| 972 | - } catch(TApplicationException $e) { |
|
| 972 | + } catch (TApplicationException $e) { |
|
| 973 | 973 | $this->fail('TApplicationException raised while trying to execute a behavior class method'); |
| 974 | 974 | } |
| 975 | 975 | |
@@ -980,14 +980,14 @@ discard block |
||
| 980 | 980 | try { |
| 981 | 981 | $this->component->faaEverMore(true, true); |
| 982 | 982 | $this->fail('TApplicationException not raised trying to execute a undefined class method'); |
| 983 | - } catch(TApplicationException $e) {} |
|
| 983 | + } catch (TApplicationException $e) {} |
|
| 984 | 984 | |
| 985 | 985 | $this->assertTrue($this->component->enableBehavior('FooBehavior')); |
| 986 | 986 | |
| 987 | 987 | $this->assertTrue($this->component->isa('FooBehavior')); |
| 988 | 988 | try { |
| 989 | 989 | $this->assertTrue($this->component->faaEverMore(true, true)); |
| 990 | - } catch(TApplicationException $e) { |
|
| 990 | + } catch (TApplicationException $e) { |
|
| 991 | 991 | $this->fail('TApplicationException raised while trying to execute a behavior class method'); |
| 992 | 992 | } |
| 993 | 993 | |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | try { |
| 1000 | 1000 | $this->component->moreFunction(true, true); |
| 1001 | 1001 | $this->fail('TApplicationException not raised trying to execute an undefined class method'); |
| 1002 | - } catch(TApplicationException $e) {} |
|
| 1002 | + } catch (TApplicationException $e) {} |
|
| 1003 | 1003 | |
| 1004 | 1004 | $this->component->attachClassBehavior('BarClassBehavior', new BarClassBehavior); |
| 1005 | 1005 | |
@@ -1008,7 +1008,7 @@ discard block |
||
| 1008 | 1008 | |
| 1009 | 1009 | try { |
| 1010 | 1010 | $this->assertTrue($this->component->moreFunction(true, true)); |
| 1011 | - } catch(TApplicationException $e) { |
|
| 1011 | + } catch (TApplicationException $e) { |
|
| 1012 | 1012 | $this->fail('TApplicationException raised while trying to execute a behavior class method'); |
| 1013 | 1013 | } |
| 1014 | 1014 | |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | try { |
| 1036 | 1036 | $this->assertNull($this->component->moreFunction(3, 4)); |
| 1037 | 1037 | $this->fail('TApplicationException not raised trying to execute a disabled behavior'); |
| 1038 | - } catch(TApplicationException $e) {} |
|
| 1038 | + } catch (TApplicationException $e) {} |
|
| 1039 | 1039 | $this->assertTrue($this->component->enableBehavior('FooBarBehavior')); |
| 1040 | 1040 | |
| 1041 | 1041 | // Test the global event space, this should work and return false because no function implements these methods |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | try { |
| 1062 | 1062 | $this->component->faafaaEverMore(3, 4); |
| 1063 | 1063 | $this->fail('TApplicationException not raised trying to execute a disabled behavior'); |
| 1064 | - } catch(TApplicationException $e) {} |
|
| 1064 | + } catch (TApplicationException $e) {} |
|
| 1065 | 1065 | |
| 1066 | 1066 | |
| 1067 | 1067 | |
@@ -1174,18 +1174,18 @@ discard block |
||
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | 1176 | public function testGetProperty() { |
| 1177 | - $this->assertTrue('default'===$this->component->Text); |
|
| 1177 | + $this->assertTrue('default' === $this->component->Text); |
|
| 1178 | 1178 | try { |
| 1179 | - $value2=$this->component->Caption; |
|
| 1179 | + $value2 = $this->component->Caption; |
|
| 1180 | 1180 | $this->fail('exception not raised when getting undefined property'); |
| 1181 | - } catch(TInvalidOperationException $e) { |
|
| 1181 | + } catch (TInvalidOperationException $e) { |
|
| 1182 | 1182 | } |
| 1183 | 1183 | |
| 1184 | 1184 | $this->assertTrue($this->component->OnMyEvent instanceof TPriorityList); |
| 1185 | 1185 | try { |
| 1186 | - $value2=$this->component->onUndefinedEvent; |
|
| 1186 | + $value2 = $this->component->onUndefinedEvent; |
|
| 1187 | 1187 | $this->fail('exception not raised when getting undefined property'); |
| 1188 | - } catch(TInvalidOperationException $e) { |
|
| 1188 | + } catch (TInvalidOperationException $e) { |
|
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | //Without the function parenthesis, the function is _not_ called but the __get |
@@ -1201,9 +1201,9 @@ discard block |
||
| 1201 | 1201 | $this->component->enableBehaviors(); |
| 1202 | 1202 | |
| 1203 | 1203 | try { |
| 1204 | - $value2=$this->component->Excitement; |
|
| 1204 | + $value2 = $this->component->Excitement; |
|
| 1205 | 1205 | $this->fail('exception not raised when getting undefined property'); |
| 1206 | - } catch(TInvalidOperationException $e) { |
|
| 1206 | + } catch (TInvalidOperationException $e) { |
|
| 1207 | 1207 | } |
| 1208 | 1208 | |
| 1209 | 1209 | $this->component->attachBehavior('BehaviorTestBehavior', $behavior = new BehaviorTestBehavior); |
@@ -1214,7 +1214,7 @@ discard block |
||
| 1214 | 1214 | try { |
| 1215 | 1215 | $this->assertEquals('faa', $this->component->Excitement); |
| 1216 | 1216 | $this->fail('exception not raised when getting undefined property'); |
| 1217 | - } catch(TInvalidOperationException $e) { |
|
| 1217 | + } catch (TInvalidOperationException $e) { |
|
| 1218 | 1218 | } |
| 1219 | 1219 | |
| 1220 | 1220 | $this->component->enableBehaviors(); |
@@ -1226,13 +1226,13 @@ discard block |
||
| 1226 | 1226 | try { |
| 1227 | 1227 | $behavior = $this->component->BehaviorTestBehavior2; |
| 1228 | 1228 | $this->fail('exception not raised when getting undefined property'); |
| 1229 | - } catch(TInvalidOperationException $e) { |
|
| 1229 | + } catch (TInvalidOperationException $e) { |
|
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | try { |
| 1233 | 1233 | $this->assertEquals('faa', $this->component->Excitement); |
| 1234 | 1234 | $this->fail('exception not raised when getting undefined property'); |
| 1235 | - } catch(TInvalidOperationException $e) { |
|
| 1235 | + } catch (TInvalidOperationException $e) { |
|
| 1236 | 1236 | } |
| 1237 | 1237 | $this->component->enableBehavior('BehaviorTestBehavior'); |
| 1238 | 1238 | $this->assertEquals('faa', $this->component->getExcitement()); |
@@ -1244,39 +1244,39 @@ discard block |
||
| 1244 | 1244 | } |
| 1245 | 1245 | |
| 1246 | 1246 | public function testSetProperty() { |
| 1247 | - $value='new value'; |
|
| 1248 | - $this->component->Text=$value; |
|
| 1249 | - $text=$this->component->Text; |
|
| 1250 | - $this->assertTrue($value===$this->component->Text); |
|
| 1247 | + $value = 'new value'; |
|
| 1248 | + $this->component->Text = $value; |
|
| 1249 | + $text = $this->component->Text; |
|
| 1250 | + $this->assertTrue($value === $this->component->Text); |
|
| 1251 | 1251 | try { |
| 1252 | - $this->component->NewMember=$value; |
|
| 1252 | + $this->component->NewMember = $value; |
|
| 1253 | 1253 | $this->fail('exception not raised when setting undefined property'); |
| 1254 | - } catch(TInvalidOperationException $e) { |
|
| 1254 | + } catch (TInvalidOperationException $e) { |
|
| 1255 | 1255 | } |
| 1256 | 1256 | |
| 1257 | 1257 | // Test get only properties is a set function |
| 1258 | 1258 | try { |
| 1259 | 1259 | $this->component->ReadOnlyProperty = 'setting read only'; |
| 1260 | 1260 | $this->fail('a property without a set function was set to a new value without error'); |
| 1261 | - } catch(TInvalidOperationException $e) { |
|
| 1261 | + } catch (TInvalidOperationException $e) { |
|
| 1262 | 1262 | } |
| 1263 | 1263 | |
| 1264 | 1264 | try { |
| 1265 | 1265 | $this->component->ReadOnlyJsProperty = 'jssetting read only'; |
| 1266 | 1266 | $this->fail('a js property without a set function was set to a new value without error'); |
| 1267 | - } catch(TInvalidOperationException $e) { |
|
| 1267 | + } catch (TInvalidOperationException $e) { |
|
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | try { |
| 1271 | 1271 | $this->component->JsReadOnlyJsProperty = 'jssetting read only'; |
| 1272 | 1272 | $this->fail('a js property without a set function was set to a new value without error'); |
| 1273 | - } catch(TInvalidOperationException $e) { |
|
| 1273 | + } catch (TInvalidOperationException $e) { |
|
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | 1276 | $this->assertEquals(0, $this->component->getEventHandlers('onMyEvent')->getCount()); |
| 1277 | - $this->component->onMyEvent = array($this->component,'myEventHandler'); |
|
| 1277 | + $this->component->onMyEvent = array($this->component, 'myEventHandler'); |
|
| 1278 | 1278 | $this->assertEquals(1, $this->component->getEventHandlers('onMyEvent')->getCount()); |
| 1279 | - $this->component->onMyEvent[] = array($this->component,'Object.myEventHandler'); |
|
| 1279 | + $this->component->onMyEvent[] = array($this->component, 'Object.myEventHandler'); |
|
| 1280 | 1280 | $this->assertEquals(2, $this->component->getEventHandlers('onMyEvent')->getCount()); |
| 1281 | 1281 | |
| 1282 | 1282 | $this->component->getEventHandlers('onMyEvent')->clear(); |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | try { |
| 1288 | 1288 | $this->component->Excitement = 'laa'; |
| 1289 | 1289 | $this->fail('exception not raised when getting undefined property'); |
| 1290 | - } catch(TInvalidOperationException $e) { |
|
| 1290 | + } catch (TInvalidOperationException $e) { |
|
| 1291 | 1291 | } |
| 1292 | 1292 | |
| 1293 | 1293 | $this->component->attachBehavior('BehaviorTestBehavior', $behavior1 = new BehaviorTestBehavior); |
@@ -1302,7 +1302,7 @@ discard block |
||
| 1302 | 1302 | $this->component->Excitement = false; |
| 1303 | 1303 | $this->assertEquals(false, $this->component->Excitement); |
| 1304 | 1304 | $this->fail('exception not raised when getting undefined property'); |
| 1305 | - } catch(TInvalidOperationException $e) { |
|
| 1305 | + } catch (TInvalidOperationException $e) { |
|
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | 1308 | $this->component->enableBehaviors(); |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | $this->component->Excitement = false; |
| 1316 | 1316 | $this->assertEquals(false, $this->component->Excitement); |
| 1317 | 1317 | $this->fail('exception not raised when getting undefined property'); |
| 1318 | - } catch(TInvalidOperationException $e) { |
|
| 1318 | + } catch (TInvalidOperationException $e) { |
|
| 1319 | 1319 | } |
| 1320 | 1320 | $this->component->enableBehavior('BehaviorTestBehavior'); |
| 1321 | 1321 | $this->component->Excitement = 'sol'; |
@@ -1341,9 +1341,9 @@ discard block |
||
| 1341 | 1341 | $this->assertTrue($this->component->BehaviorTestBehavior->onBehaviorEvent instanceof TPriorityList); |
| 1342 | 1342 | |
| 1343 | 1343 | $this->assertEquals(0, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); |
| 1344 | - $this->component->onBehaviorEvent = array($this->component,'myEventHandler'); |
|
| 1344 | + $this->component->onBehaviorEvent = array($this->component, 'myEventHandler'); |
|
| 1345 | 1345 | $this->assertEquals(1, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); |
| 1346 | - $this->component->onBehaviorEvent[] = array($this->component,'Object.myEventHandler'); |
|
| 1346 | + $this->component->onBehaviorEvent[] = array($this->component, 'Object.myEventHandler'); |
|
| 1347 | 1347 | $this->assertEquals(2, $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->getCount()); |
| 1348 | 1348 | |
| 1349 | 1349 | $this->component->BehaviorTestBehavior->getEventHandlers('onBehaviorEvent')->clear(); |
@@ -1366,10 +1366,10 @@ discard block |
||
| 1366 | 1366 | $this->assertTrue(isset($this->component->BehaviorTestBehavior)); |
| 1367 | 1367 | $this->assertFalse(isset($this->component->onBehaviorEvent)); |
| 1368 | 1368 | |
| 1369 | - $this->component->attachEventHandler('onBehaviorEvent','foo'); |
|
| 1369 | + $this->component->attachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1370 | 1370 | $this->assertTrue(isset($this->component->onBehaviorEvent)); |
| 1371 | 1371 | |
| 1372 | - $this->component->attachEventHandler('onMyEvent','foo'); |
|
| 1372 | + $this->component->attachEventHandler('onMyEvent', 'foo'); |
|
| 1373 | 1373 | $this->assertTrue(isset($this->component->onMyEvent)); |
| 1374 | 1374 | |
| 1375 | 1375 | $this->assertTrue(isset($this->component->Excitement)); |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | |
| 1392 | 1392 | // object events |
| 1393 | 1393 | $this->assertEquals(0, $this->component->onMyEvent->Count); |
| 1394 | - $this->component->attachEventHandler('onMyEvent','foo'); |
|
| 1394 | + $this->component->attachEventHandler('onMyEvent', 'foo'); |
|
| 1395 | 1395 | $this->assertEquals(1, $this->component->onMyEvent->Count); |
| 1396 | 1396 | unset($this->component->onMyEvent); |
| 1397 | 1397 | $this->assertEquals(0, $this->component->onMyEvent->Count); |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | try { |
| 1409 | 1409 | unset($this->component->Object); |
| 1410 | 1410 | $this->fail('TInvalidOperationException not raised when unsetting get only property'); |
| 1411 | - } catch(TInvalidOperationException $e) {} |
|
| 1411 | + } catch (TInvalidOperationException $e) {} |
|
| 1412 | 1412 | |
| 1413 | 1413 | $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); |
| 1414 | 1414 | $this->assertTrue($this->component->asa('BehaviorTestBehavior') instanceof BehaviorTestBehavior); |
@@ -1437,7 +1437,7 @@ discard block |
||
| 1437 | 1437 | try { |
| 1438 | 1438 | unset($this->component->ReadOnly); |
| 1439 | 1439 | $this->fail('TInvalidOperationException not raised when unsetting get only property'); |
| 1440 | - } catch(TInvalidOperationException $e) {} |
|
| 1440 | + } catch (TInvalidOperationException $e) {} |
|
| 1441 | 1441 | |
| 1442 | 1442 | $this->component->onBehaviorEvent = 'foo'; |
| 1443 | 1443 | $this->assertEquals(1, count($this->component->onBehaviorEvent)); |
@@ -1453,12 +1453,12 @@ discard block |
||
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | public function testGetSubProperty() { |
| 1456 | - $this->assertTrue('object text'===$this->component->getSubProperty('Object.Text')); |
|
| 1456 | + $this->assertTrue('object text' === $this->component->getSubProperty('Object.Text')); |
|
| 1457 | 1457 | } |
| 1458 | 1458 | |
| 1459 | 1459 | public function testSetSubProperty() { |
| 1460 | - $this->component->setSubProperty('Object.Text','new object text'); |
|
| 1461 | - $this->assertEquals('new object text',$this->component->getSubProperty('Object.Text')); |
|
| 1460 | + $this->component->setSubProperty('Object.Text', 'new object text'); |
|
| 1461 | + $this->assertEquals('new object text', $this->component->getSubProperty('Object.Text')); |
|
| 1462 | 1462 | } |
| 1463 | 1463 | |
| 1464 | 1464 | public function testHasEvent() { |
@@ -1492,11 +1492,11 @@ discard block |
||
| 1492 | 1492 | |
| 1493 | 1493 | public function testHasEventHandler() { |
| 1494 | 1494 | $this->assertFalse($this->component->hasEventHandler('OnMyEvent')); |
| 1495 | - $this->component->attachEventHandler('OnMyEvent','foo'); |
|
| 1495 | + $this->component->attachEventHandler('OnMyEvent', 'foo'); |
|
| 1496 | 1496 | $this->assertTrue($this->component->hasEventHandler('OnMyEvent')); |
| 1497 | 1497 | |
| 1498 | 1498 | $this->assertFalse($this->component->hasEventHandler('fxNonExistantGlobalEvent')); |
| 1499 | - $this->component->attachEventHandler('fxNonExistantGlobalEvent','foo'); |
|
| 1499 | + $this->component->attachEventHandler('fxNonExistantGlobalEvent', 'foo'); |
|
| 1500 | 1500 | $this->assertTrue($this->component->hasEventHandler('fxNonExistantGlobalEvent')); |
| 1501 | 1501 | |
| 1502 | 1502 | //Test behavior events |
@@ -1505,7 +1505,7 @@ discard block |
||
| 1505 | 1505 | $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); |
| 1506 | 1506 | $this->assertFalse($this->component->BehaviorTestBehavior->hasEventHandler('onBehaviorEvent')); |
| 1507 | 1507 | |
| 1508 | - $this->component->attachEventHandler('onBehaviorEvent','foo'); |
|
| 1508 | + $this->component->attachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1509 | 1509 | $this->assertTrue($this->component->hasEventHandler('onBehaviorEvent')); |
| 1510 | 1510 | |
| 1511 | 1511 | $this->component->disableBehavior('BehaviorTestBehavior'); |
@@ -1517,23 +1517,23 @@ discard block |
||
| 1517 | 1517 | } |
| 1518 | 1518 | |
| 1519 | 1519 | public function testGetEventHandlers() { |
| 1520 | - $list=$this->component->getEventHandlers('OnMyEvent'); |
|
| 1521 | - $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0)); |
|
| 1522 | - $this->component->attachEventHandler('OnMyEvent','foo'); |
|
| 1523 | - $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===1)); |
|
| 1520 | + $list = $this->component->getEventHandlers('OnMyEvent'); |
|
| 1521 | + $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount() === 0)); |
|
| 1522 | + $this->component->attachEventHandler('OnMyEvent', 'foo'); |
|
| 1523 | + $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount() === 1)); |
|
| 1524 | 1524 | try { |
| 1525 | - $list=$this->component->getEventHandlers('YourEvent'); |
|
| 1525 | + $list = $this->component->getEventHandlers('YourEvent'); |
|
| 1526 | 1526 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1527 | - } catch(TInvalidOperationException $e) { |
|
| 1527 | + } catch (TInvalidOperationException $e) { |
|
| 1528 | 1528 | } |
| 1529 | 1529 | |
| 1530 | - $list=$this->component->getEventHandlers('fxRandomEvent'); |
|
| 1531 | - $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0)); |
|
| 1532 | - $this->component->attachEventHandler('fxRandomEvent','foo'); |
|
| 1533 | - $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===1)); |
|
| 1530 | + $list = $this->component->getEventHandlers('fxRandomEvent'); |
|
| 1531 | + $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount() === 0)); |
|
| 1532 | + $this->component->attachEventHandler('fxRandomEvent', 'foo'); |
|
| 1533 | + $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount() === 1)); |
|
| 1534 | 1534 | try { |
| 1535 | - $list=$this->component->getEventHandlers('fxSomeUndefinedGlobalEvent'); |
|
| 1536 | - } catch(TInvalidOperationException $e) { |
|
| 1535 | + $list = $this->component->getEventHandlers('fxSomeUndefinedGlobalEvent'); |
|
| 1536 | + } catch (TInvalidOperationException $e) { |
|
| 1537 | 1537 | $this->fail('exception raised when getting event handlers for universal global event'); |
| 1538 | 1538 | } |
| 1539 | 1539 | |
@@ -1541,43 +1541,43 @@ discard block |
||
| 1541 | 1541 | |
| 1542 | 1542 | //Test behavior events |
| 1543 | 1543 | try { |
| 1544 | - $list=$this->component->getEventHandlers('onBehaviorEvent'); |
|
| 1544 | + $list = $this->component->getEventHandlers('onBehaviorEvent'); |
|
| 1545 | 1545 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1546 | - } catch(TInvalidOperationException $e) { |
|
| 1546 | + } catch (TInvalidOperationException $e) { |
|
| 1547 | 1547 | } |
| 1548 | 1548 | $this->assertFalse($this->component->hasEventHandler('onBehaviorEvent')); |
| 1549 | 1549 | |
| 1550 | 1550 | $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); |
| 1551 | - $list=$this->component->getEventHandlers('onBehaviorEvent'); |
|
| 1552 | - $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===0)); |
|
| 1553 | - $this->component->attachEventHandler('onBehaviorEvent','foo'); |
|
| 1554 | - $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount()===1)); |
|
| 1551 | + $list = $this->component->getEventHandlers('onBehaviorEvent'); |
|
| 1552 | + $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount() === 0)); |
|
| 1553 | + $this->component->attachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1554 | + $this->assertTrue(($list instanceof TPriorityList) && ($list->getCount() === 1)); |
|
| 1555 | 1555 | |
| 1556 | 1556 | $this->component->disableBehavior('BehaviorTestBehavior'); |
| 1557 | 1557 | try { |
| 1558 | - $list=$this->component->getEventHandlers('onBehaviorEvent'); |
|
| 1558 | + $list = $this->component->getEventHandlers('onBehaviorEvent'); |
|
| 1559 | 1559 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1560 | - } catch(TInvalidOperationException $e) { |
|
| 1560 | + } catch (TInvalidOperationException $e) { |
|
| 1561 | 1561 | } |
| 1562 | 1562 | $this->component->enableBehavior('BehaviorTestBehavior'); |
| 1563 | - $this->assertTrue(($this->component->getEventHandlers('onBehaviorEvent') instanceof TPriorityList) && ($list->getCount()===1)); |
|
| 1563 | + $this->assertTrue(($this->component->getEventHandlers('onBehaviorEvent') instanceof TPriorityList) && ($list->getCount() === 1)); |
|
| 1564 | 1564 | |
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | public function testAttachEventHandler() { |
| 1568 | 1568 | |
| 1569 | - $this->component->attachEventHandler('OnMyEvent','foo'); |
|
| 1569 | + $this->component->attachEventHandler('OnMyEvent', 'foo'); |
|
| 1570 | 1570 | $this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount()); |
| 1571 | 1571 | try { |
| 1572 | - $this->component->attachEventHandler('YourEvent','foo'); |
|
| 1572 | + $this->component->attachEventHandler('YourEvent', 'foo'); |
|
| 1573 | 1573 | $this->fail('exception not raised when attaching event handlers for undefined event'); |
| 1574 | - } catch(TInvalidOperationException $e) { |
|
| 1574 | + } catch (TInvalidOperationException $e) { |
|
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | //Testing the priorities of attaching events |
| 1578 | - $this->component->attachEventHandler('OnMyEvent','foopre', 5); |
|
| 1579 | - $this->component->attachEventHandler('OnMyEvent','foopost', 15); |
|
| 1580 | - $this->component->attachEventHandler('OnMyEvent','foobar', 10); |
|
| 1578 | + $this->component->attachEventHandler('OnMyEvent', 'foopre', 5); |
|
| 1579 | + $this->component->attachEventHandler('OnMyEvent', 'foopost', 15); |
|
| 1580 | + $this->component->attachEventHandler('OnMyEvent', 'foobar', 10); |
|
| 1581 | 1581 | $this->assertEquals(4, $this->component->getEventHandlers('OnMyEvent')->getCount()); |
| 1582 | 1582 | $list = $this->component->getEventHandlers('OnMyEvent'); |
| 1583 | 1583 | $this->assertEquals('foopre', $list[0]); |
@@ -1588,19 +1588,19 @@ discard block |
||
| 1588 | 1588 | |
| 1589 | 1589 | //Test attaching behavior events |
| 1590 | 1590 | try { |
| 1591 | - $this->component->attachEventHandler('onBehaviorEvent','foo'); |
|
| 1591 | + $this->component->attachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1592 | 1592 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1593 | - } catch(TInvalidOperationException $e) { |
|
| 1593 | + } catch (TInvalidOperationException $e) { |
|
| 1594 | 1594 | } |
| 1595 | 1595 | $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); |
| 1596 | 1596 | |
| 1597 | - $this->component->attachEventHandler('onBehaviorEvent','foo'); |
|
| 1597 | + $this->component->attachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1598 | 1598 | |
| 1599 | 1599 | //Testing the priorities of attaching behavior events |
| 1600 | - $this->component->attachEventHandler('onBehaviorEvent','foopre', 5); |
|
| 1601 | - $this->component->attachEventHandler('onBehaviorEvent','foopost', 15); |
|
| 1602 | - $this->component->attachEventHandler('onBehaviorEvent','foobar', 10); |
|
| 1603 | - $this->component->attachEventHandler('onBehaviorEvent','foobarfoobar', 10); |
|
| 1600 | + $this->component->attachEventHandler('onBehaviorEvent', 'foopre', 5); |
|
| 1601 | + $this->component->attachEventHandler('onBehaviorEvent', 'foopost', 15); |
|
| 1602 | + $this->component->attachEventHandler('onBehaviorEvent', 'foobar', 10); |
|
| 1603 | + $this->component->attachEventHandler('onBehaviorEvent', 'foobarfoobar', 10); |
|
| 1604 | 1604 | $this->assertEquals(5, $this->component->getEventHandlers('onBehaviorEvent')->getCount()); |
| 1605 | 1605 | $list = $this->component->getEventHandlers('onBehaviorEvent'); |
| 1606 | 1606 | $this->assertEquals('foopre', $list[0]); |
@@ -1611,9 +1611,9 @@ discard block |
||
| 1611 | 1611 | |
| 1612 | 1612 | $this->component->disableBehavior('BehaviorTestBehavior'); |
| 1613 | 1613 | try { |
| 1614 | - $this->component->attachEventHandler('onBehaviorEvent','bar'); |
|
| 1614 | + $this->component->attachEventHandler('onBehaviorEvent', 'bar'); |
|
| 1615 | 1615 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1616 | - } catch(TInvalidOperationException $e) { |
|
| 1616 | + } catch (TInvalidOperationException $e) { |
|
| 1617 | 1617 | } |
| 1618 | 1618 | $this->component->enableBehavior('BehaviorTestBehavior'); |
| 1619 | 1619 | |
@@ -1621,17 +1621,17 @@ discard block |
||
| 1621 | 1621 | |
| 1622 | 1622 | public function testDetachEventHandler() { |
| 1623 | 1623 | |
| 1624 | - $this->component->attachEventHandler('OnMyEvent','foo'); |
|
| 1624 | + $this->component->attachEventHandler('OnMyEvent', 'foo'); |
|
| 1625 | 1625 | $this->assertEquals(1, $this->component->getEventHandlers('OnMyEvent')->getCount()); |
| 1626 | 1626 | |
| 1627 | - $this->component->attachEventHandler('OnMyEvent','foopre', 5); |
|
| 1628 | - $this->component->attachEventHandler('OnMyEvent','foopost', 15); |
|
| 1629 | - $this->component->attachEventHandler('OnMyEvent','foobar', 10); |
|
| 1630 | - $this->component->attachEventHandler('OnMyEvent','foobarfoobar', 10); |
|
| 1627 | + $this->component->attachEventHandler('OnMyEvent', 'foopre', 5); |
|
| 1628 | + $this->component->attachEventHandler('OnMyEvent', 'foopost', 15); |
|
| 1629 | + $this->component->attachEventHandler('OnMyEvent', 'foobar', 10); |
|
| 1630 | + $this->component->attachEventHandler('OnMyEvent', 'foobarfoobar', 10); |
|
| 1631 | 1631 | |
| 1632 | 1632 | |
| 1633 | 1633 | |
| 1634 | - $this->component->detachEventHandler('OnMyEvent','foo'); |
|
| 1634 | + $this->component->detachEventHandler('OnMyEvent', 'foo'); |
|
| 1635 | 1635 | $list = $this->component->getEventHandlers('OnMyEvent'); |
| 1636 | 1636 | $this->assertEquals(4, $list->getCount()); |
| 1637 | 1637 | |
@@ -1640,32 +1640,32 @@ discard block |
||
| 1640 | 1640 | $this->assertEquals('foobarfoobar', $list[2]); |
| 1641 | 1641 | $this->assertEquals('foopost', $list[3]); |
| 1642 | 1642 | |
| 1643 | - $this->component->detachEventHandler('OnMyEvent','foopre', null); |
|
| 1643 | + $this->component->detachEventHandler('OnMyEvent', 'foopre', null); |
|
| 1644 | 1644 | $this->assertEquals(4, $list->getCount()); |
| 1645 | 1645 | |
| 1646 | - $this->component->detachEventHandler('OnMyEvent','foopre', 5); |
|
| 1646 | + $this->component->detachEventHandler('OnMyEvent', 'foopre', 5); |
|
| 1647 | 1647 | $this->assertEquals(3, $list->getCount()); |
| 1648 | 1648 | |
| 1649 | 1649 | |
| 1650 | 1650 | // Now do detaching of behavior on events |
| 1651 | 1651 | try { |
| 1652 | - $this->component->attachEventHandler('onBehaviorEvent','foo'); |
|
| 1652 | + $this->component->attachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1653 | 1653 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1654 | - } catch(TInvalidOperationException $e) { |
|
| 1654 | + } catch (TInvalidOperationException $e) { |
|
| 1655 | 1655 | } |
| 1656 | 1656 | $this->component->attachBehavior('BehaviorTestBehavior', new BehaviorTestBehavior); |
| 1657 | 1657 | |
| 1658 | - $this->component->attachEventHandler('onBehaviorEvent','foo'); |
|
| 1658 | + $this->component->attachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1659 | 1659 | $this->assertEquals(1, $this->component->getEventHandlers('onBehaviorEvent')->getCount()); |
| 1660 | 1660 | |
| 1661 | - $this->component->attachEventHandler('onBehaviorEvent','foopre', 5); |
|
| 1662 | - $this->component->attachEventHandler('onBehaviorEvent','foopost', 15); |
|
| 1663 | - $this->component->attachEventHandler('onBehaviorEvent','foobar', 10); |
|
| 1664 | - $this->component->attachEventHandler('onBehaviorEvent','foobarfoobar', 10); |
|
| 1661 | + $this->component->attachEventHandler('onBehaviorEvent', 'foopre', 5); |
|
| 1662 | + $this->component->attachEventHandler('onBehaviorEvent', 'foopost', 15); |
|
| 1663 | + $this->component->attachEventHandler('onBehaviorEvent', 'foobar', 10); |
|
| 1664 | + $this->component->attachEventHandler('onBehaviorEvent', 'foobarfoobar', 10); |
|
| 1665 | 1665 | |
| 1666 | 1666 | |
| 1667 | 1667 | |
| 1668 | - $this->component->detachEventHandler('onBehaviorEvent','foo'); |
|
| 1668 | + $this->component->detachEventHandler('onBehaviorEvent', 'foo'); |
|
| 1669 | 1669 | $list = $this->component->getEventHandlers('onBehaviorEvent'); |
| 1670 | 1670 | $this->assertEquals(4, $list->getCount()); |
| 1671 | 1671 | |
@@ -1674,10 +1674,10 @@ discard block |
||
| 1674 | 1674 | $this->assertEquals('foobarfoobar', $list[2]); |
| 1675 | 1675 | $this->assertEquals('foopost', $list[3]); |
| 1676 | 1676 | |
| 1677 | - $this->component->detachEventHandler('onBehaviorEvent','foopre', null); |
|
| 1677 | + $this->component->detachEventHandler('onBehaviorEvent', 'foopre', null); |
|
| 1678 | 1678 | $this->assertEquals(4, $list->getCount()); |
| 1679 | 1679 | |
| 1680 | - $this->component->detachEventHandler('onBehaviorEvent','foopre', 5); |
|
| 1680 | + $this->component->detachEventHandler('onBehaviorEvent', 'foopre', 5); |
|
| 1681 | 1681 | $this->assertEquals(3, $list->getCount()); |
| 1682 | 1682 | } |
| 1683 | 1683 | |
@@ -1685,13 +1685,13 @@ discard block |
||
| 1685 | 1685 | |
| 1686 | 1686 | |
| 1687 | 1687 | public function testRaiseEvent() { |
| 1688 | - $this->component->attachEventHandler('OnMyEvent',array($this->component,'myEventHandler')); |
|
| 1688 | + $this->component->attachEventHandler('OnMyEvent', array($this->component, 'myEventHandler')); |
|
| 1689 | 1689 | $this->assertFalse($this->component->isEventHandled()); |
| 1690 | - $this->component->raiseEvent('OnMyEvent',$this,null); |
|
| 1690 | + $this->component->raiseEvent('OnMyEvent', $this, null); |
|
| 1691 | 1691 | $this->assertTrue($this->component->isEventHandled()); |
| 1692 | - $this->component->attachEventHandler('OnMyEvent',array($this->component,'Object.myEventHandler')); |
|
| 1692 | + $this->component->attachEventHandler('OnMyEvent', array($this->component, 'Object.myEventHandler')); |
|
| 1693 | 1693 | $this->assertFalse($this->component->Object->isEventHandled()); |
| 1694 | - $this->component->raiseEvent('OnMyEvent',$this,null); |
|
| 1694 | + $this->component->raiseEvent('OnMyEvent', $this, null); |
|
| 1695 | 1695 | $this->assertTrue($this->component->Object->isEventHandled()); |
| 1696 | 1696 | |
| 1697 | 1697 | $this->component->resetEventHandled(); |
@@ -1701,13 +1701,13 @@ discard block |
||
| 1701 | 1701 | // Test a behavior on event |
| 1702 | 1702 | $this->component->attachBehavior('test', new BehaviorTestBehavior); |
| 1703 | 1703 | |
| 1704 | - $this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler')); |
|
| 1704 | + $this->component->attachEventHandler('onBehaviorEvent', array($this->component, 'myEventHandler')); |
|
| 1705 | 1705 | $this->assertFalse($this->component->isEventHandled()); |
| 1706 | - $this->component->raiseEvent('onBehaviorEvent',$this,null); |
|
| 1706 | + $this->component->raiseEvent('onBehaviorEvent', $this, null); |
|
| 1707 | 1707 | $this->assertTrue($this->component->isEventHandled()); |
| 1708 | - $this->component->attachEventHandler('onBehaviorEvent',array($this->component,'Object.myEventHandler')); |
|
| 1708 | + $this->component->attachEventHandler('onBehaviorEvent', array($this->component, 'Object.myEventHandler')); |
|
| 1709 | 1709 | $this->assertFalse($this->component->Object->isEventHandled()); |
| 1710 | - $this->component->raiseEvent('onBehaviorEvent',$this,null); |
|
| 1710 | + $this->component->raiseEvent('onBehaviorEvent', $this, null); |
|
| 1711 | 1711 | $this->assertTrue($this->component->Object->isEventHandled()); |
| 1712 | 1712 | |
| 1713 | 1713 | //test behavior enabled/disabled events |
@@ -1717,14 +1717,14 @@ discard block |
||
| 1717 | 1717 | $this->component->Object->resetEventHandled(); |
| 1718 | 1718 | |
| 1719 | 1719 | try { |
| 1720 | - $this->component->attachEventHandler('onBehaviorEvent',array($this->component,'myEventHandler')); |
|
| 1720 | + $this->component->attachEventHandler('onBehaviorEvent', array($this->component, 'myEventHandler')); |
|
| 1721 | 1721 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1722 | - } catch(TInvalidOperationException $e) {} |
|
| 1722 | + } catch (TInvalidOperationException $e) {} |
|
| 1723 | 1723 | $this->assertFalse($this->component->isEventHandled()); |
| 1724 | 1724 | try { |
| 1725 | - $this->component->raiseEvent('onBehaviorEvent',$this,null); |
|
| 1725 | + $this->component->raiseEvent('onBehaviorEvent', $this, null); |
|
| 1726 | 1726 | $this->fail('exception not raised when getting event handlers for undefined event'); |
| 1727 | - } catch(TInvalidOperationException $e) {} |
|
| 1727 | + } catch (TInvalidOperationException $e) {} |
|
| 1728 | 1728 | $this->assertFalse($this->component->isEventHandled()); |
| 1729 | 1729 | |
| 1730 | 1730 | $this->component->enableBehavior('test'); |
@@ -1735,12 +1735,12 @@ discard block |
||
| 1735 | 1735 | |
| 1736 | 1736 | $this->assertFalse($this->component->isEventHandled()); |
| 1737 | 1737 | $this->assertFalse($this->component->Object->isEventHandled()); |
| 1738 | - $this->assertEquals(array(), $this->component->onBehaviorEvent($this,$this->component)); |
|
| 1738 | + $this->assertEquals(array(), $this->component->onBehaviorEvent($this, $this->component)); |
|
| 1739 | 1739 | $this->assertTrue($this->component->isEventHandled()); |
| 1740 | 1740 | $this->assertTrue($this->component->Object->isEventHandled()); |
| 1741 | 1741 | |
| 1742 | 1742 | // This accumulates all the responses from each of the events |
| 1743 | - $arr=$this->component->onBehaviorEvent($this, $this->component, TEventResults::EVENT_RESULT_ALL); |
|
| 1743 | + $arr = $this->component->onBehaviorEvent($this, $this->component, TEventResults::EVENT_RESULT_ALL); |
|
| 1744 | 1744 | $this->assertEquals($this, $arr[0]['sender']); |
| 1745 | 1745 | $this->assertEquals($this->component, $arr[0]['param']); |
| 1746 | 1746 | $this->assertTrue(null === $arr[0]['response']); |
@@ -1752,7 +1752,7 @@ discard block |
||
| 1752 | 1752 | $this->assertEquals(2, count($arr)); |
| 1753 | 1753 | |
| 1754 | 1754 | // This tests without the default filtering-out of null |
| 1755 | - $arr=$this->component->onBehaviorEvent($this, $this->component, false); |
|
| 1755 | + $arr = $this->component->onBehaviorEvent($this, $this->component, false); |
|
| 1756 | 1756 | $this->assertEquals(array(null, null), $arr); |
| 1757 | 1757 | |
| 1758 | 1758 | |
@@ -1763,9 +1763,9 @@ discard block |
||
| 1763 | 1763 | $this->component->onBehaviorEvent = array($this, 'returnValue1'); |
| 1764 | 1764 | |
| 1765 | 1765 | // Test the per event post processing function |
| 1766 | - $arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction')); |
|
| 1766 | + $arr = $this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction')); |
|
| 1767 | 1767 | $this->assertEquals(array(exp(4), exp(1)), $arr); |
| 1768 | - $arr=$this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction2')); |
|
| 1768 | + $arr = $this->component->onBehaviorEvent($this, $this->component, array($this, 'postEventFunction2')); |
|
| 1769 | 1769 | $this->assertEquals(array(sin(4), sin(1)), $arr); |
| 1770 | 1770 | |
| 1771 | 1771 | |
@@ -1774,7 +1774,7 @@ discard block |
||
| 1774 | 1774 | |
| 1775 | 1775 | $this->component->onBehaviorEvent = array($this, 'ffValue4'); |
| 1776 | 1776 | $this->component->onBehaviorEvent = array($this, 'ffValue2'); |
| 1777 | - $arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); |
|
| 1777 | + $arr = $this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); |
|
| 1778 | 1778 | $this->assertEquals(array(20, 40), $arr); |
| 1779 | 1779 | |
| 1780 | 1780 | |
@@ -1783,16 +1783,16 @@ discard block |
||
| 1783 | 1783 | //Order of these events affects the response order in feed forward |
| 1784 | 1784 | $this->component->onBehaviorEvent = array($this, 'ffValue2'); |
| 1785 | 1785 | $this->component->onBehaviorEvent = array($this, 'ffValue4'); |
| 1786 | - $arr=$this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); |
|
| 1786 | + $arr = $this->component->onBehaviorEvent($this, 5, TEventResults::EVENT_RESULT_FEED_FORWARD); |
|
| 1787 | 1787 | $this->assertEquals(array(10, 40), $arr); |
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | - public function returnValue1(){return 1;} |
|
| 1791 | - public function returnValue4(){return 4;} |
|
| 1792 | - public function postEventFunction($sender, $param, $caller, $response){return exp($response);} |
|
| 1793 | - public function postEventFunction2($sender, $param, $caller, $response){return sin($response);} |
|
| 1794 | - public function ffValue2($sender, $param){return $param*2;} |
|
| 1795 | - public function ffValue4($sender, $param){return $param*4;} |
|
| 1790 | + public function returnValue1() {return 1; } |
|
| 1791 | + public function returnValue4() {return 4; } |
|
| 1792 | + public function postEventFunction($sender, $param, $caller, $response) {return exp($response); } |
|
| 1793 | + public function postEventFunction2($sender, $param, $caller, $response) {return sin($response); } |
|
| 1794 | + public function ffValue2($sender, $param) {return $param * 2; } |
|
| 1795 | + public function ffValue4($sender, $param) {return $param * 4; } |
|
| 1796 | 1796 | |
| 1797 | 1797 | |
| 1798 | 1798 | public function testGlobalEventListenerInRaiseEvent() { |
@@ -1816,7 +1816,7 @@ discard block |
||
| 1816 | 1816 | try { |
| 1817 | 1817 | $this->component->objectAndBehaviorUndefinedMethod(); |
| 1818 | 1818 | $this->fail('exception not raised when evaluating an undefined method by the object and behavior'); |
| 1819 | - } catch(TApplicationException $e) { |
|
| 1819 | + } catch (TApplicationException $e) { |
|
| 1820 | 1820 | } |
| 1821 | 1821 | |
| 1822 | 1822 | // calling undefined dynamic method, caught by the __dycall method in the behavior and implemented |
@@ -1851,7 +1851,7 @@ discard block |
||
| 1851 | 1851 | try { |
| 1852 | 1852 | $this->component->objectAndBehaviorUndefinedMethod(); |
| 1853 | 1853 | $this->fail('exception not raised when evaluating an undefined method by the object and behavior'); |
| 1854 | - } catch(TApplicationException $e) { |
|
| 1854 | + } catch (TApplicationException $e) { |
|
| 1855 | 1855 | } |
| 1856 | 1856 | |
| 1857 | 1857 | // calling undefined dynamic method, caught by the __dycall method in the behavior and implemented |
@@ -1899,12 +1899,12 @@ discard block |
||
| 1899 | 1899 | |
| 1900 | 1900 | |
| 1901 | 1901 | public function testEvaluateExpression() { |
| 1902 | - $expression="1+2"; |
|
| 1903 | - $this->assertTrue(3===$this->component->evaluateExpression($expression)); |
|
| 1902 | + $expression = "1+2"; |
|
| 1903 | + $this->assertTrue(3 === $this->component->evaluateExpression($expression)); |
|
| 1904 | 1904 | try { |
| 1905 | - $button=$this->component->evaluateExpression('$this->button'); |
|
| 1905 | + $button = $this->component->evaluateExpression('$this->button'); |
|
| 1906 | 1906 | $this->fail('exception not raised when evaluating an invalid exception'); |
| 1907 | - } catch(Exception $e) { |
|
| 1907 | + } catch (Exception $e) { |
|
| 1908 | 1908 | } |
| 1909 | 1909 | } |
| 1910 | 1910 | |
@@ -1912,13 +1912,13 @@ discard block |
||
| 1912 | 1912 | |
| 1913 | 1913 | |
| 1914 | 1914 | public function testEvaluateStatements() { |
| 1915 | - $statements='$a="test string"; echo $a;'; |
|
| 1916 | - $this->assertEquals('test string',$this->component->evaluateStatements($statements)); |
|
| 1915 | + $statements = '$a="test string"; echo $a;'; |
|
| 1916 | + $this->assertEquals('test string', $this->component->evaluateStatements($statements)); |
|
| 1917 | 1917 | try { |
| 1918 | - $statements='$a=new NewComponent; echo $a->button;'; |
|
| 1919 | - $button=$this->component->evaluateStatements($statements); |
|
| 1918 | + $statements = '$a=new NewComponent; echo $a->button;'; |
|
| 1919 | + $button = $this->component->evaluateStatements($statements); |
|
| 1920 | 1920 | $this->fail('exception not raised when evaluating an invalid statement'); |
| 1921 | - } catch(Exception $e) { |
|
| 1921 | + } catch (Exception $e) { |
|
| 1922 | 1922 | } |
| 1923 | 1923 | } |
| 1924 | 1924 | |
@@ -1944,7 +1944,7 @@ discard block |
||
| 1944 | 1944 | |
| 1945 | 1945 | $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? ')); |
| 1946 | 1946 | |
| 1947 | - $this->assertEquals(0.25, $this->component->dyPowerFunction(2,2)); |
|
| 1947 | + $this->assertEquals(0.25, $this->component->dyPowerFunction(2, 2)); |
|
| 1948 | 1948 | |
| 1949 | 1949 | |
| 1950 | 1950 | $this->component->detachBehavior('dy1'); |
@@ -1972,7 +1972,7 @@ discard block |
||
| 1972 | 1972 | |
| 1973 | 1973 | $this->assertEquals(' aa bb cc __ .. ++ || !! ?? ', $this->component->dyUndefinedEvent(' aa bb cc __ .. ++ || !! ?? ')); |
| 1974 | 1974 | |
| 1975 | - $this->assertEquals(0.25, $this->component->dyPowerFunction(2,2)); |
|
| 1975 | + $this->assertEquals(0.25, $this->component->dyPowerFunction(2, 2)); |
|
| 1976 | 1976 | |
| 1977 | 1977 | |
| 1978 | 1978 | } |
@@ -2001,7 +2001,7 @@ discard block |
||
| 2001 | 2001 | $this->assertEquals(3, $this->component->evaluateExpression('1+2')); |
| 2002 | 2002 | $this->assertEquals(7, $this->component->IntraEvents->LastCall); |
| 2003 | 2003 | |
| 2004 | - $statements='$a="test string"; echo $a;'; |
|
| 2004 | + $statements = '$a="test string"; echo $a;'; |
|
| 2005 | 2005 | $this->assertEquals('test string', $this->component->evaluateStatements($statements)); |
| 2006 | 2006 | $this->assertEquals(8, $this->component->IntraEvents->LastCall); |
| 2007 | 2007 | |
@@ -2032,8 +2032,8 @@ discard block |
||
| 2032 | 2032 | $this->assertEquals(12, $this->component->IntraEvents->LastCall); |
| 2033 | 2033 | |
| 2034 | 2034 | |
| 2035 | - $this->component->attachEventHandler('OnMyEvent',array($this->component,'myEventHandler')); |
|
| 2036 | - $this->component->raiseEvent('OnMyEvent',$this,null); |
|
| 2035 | + $this->component->attachEventHandler('OnMyEvent', array($this->component, 'myEventHandler')); |
|
| 2036 | + $this->component->raiseEvent('OnMyEvent', $this, null); |
|
| 2037 | 2037 | |
| 2038 | 2038 | //3 + 4 + 5 + 6 = 18 (the behavior adds these together when each raiseEvent dynamic intra event is called) |
| 2039 | 2039 | $this->assertEquals(18, $this->component->IntraEvents->LastCall); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | public function testConstructTList() |
| 76 | 76 | { |
| 77 | 77 | $a = array( |
| 78 | - 1,2,3 |
|
| 78 | + 1, 2, 3 |
|
| 79 | 79 | ); |
| 80 | 80 | $list = new TPriorityList($a); |
| 81 | 81 | $this->assertEquals(3, $list->getCount()); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | public function testCanNotRemoveWhenReadOnlyTList() |
| 242 | 242 | { |
| 243 | 243 | $list = new TPriorityList(array( |
| 244 | - 1,2,3 |
|
| 244 | + 1, 2, 3 |
|
| 245 | 245 | ), true); |
| 246 | 246 | try { |
| 247 | 247 | $list->remove(2); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | $list = new TPriorityList(array( |
| 254 | - 1,2,3 |
|
| 254 | + 1, 2, 3 |
|
| 255 | 255 | ), true); |
| 256 | 256 | try { |
| 257 | 257 | $list->remove(10); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | public function testCanNotRemoveAtWhenReadOnlyTList() |
| 280 | 280 | { |
| 281 | 281 | $list = new TPriorityList(array( |
| 282 | - 1,2,3 |
|
| 282 | + 1, 2, 3 |
|
| 283 | 283 | ), true); |
| 284 | 284 | try { |
| 285 | 285 | $list->removeAt(2); |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $list = new TPriorityList(array( |
| 292 | - 1,2,3 |
|
| 292 | + 1, 2, 3 |
|
| 293 | 293 | ), true); |
| 294 | 294 | try { |
| 295 | 295 | $list->removeAt(10); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | public function testCanNotClearWhenReadOnlyTList() |
| 311 | 311 | { |
| 312 | 312 | $list = new TPriorityList(array( |
| 313 | - 1,2,3 |
|
| 313 | + 1, 2, 3 |
|
| 314 | 314 | ), true); |
| 315 | 315 | try { |
| 316 | 316 | $list->clear(); |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | public function testCopyFromTList() |
| 339 | 339 | { |
| 340 | 340 | $array = array( |
| 341 | - $this->item3,$this->item1 |
|
| 341 | + $this->item3, $this->item1 |
|
| 342 | 342 | ); |
| 343 | 343 | $this->list->copyFrom($array); |
| 344 | 344 | $this->assertTrue(count($array) == 2 && $this->list[0] === $this->item3 && $this->list[1] === $this->item1); |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | public function testMergeWithTList() |
| 354 | 354 | { |
| 355 | 355 | $array = array( |
| 356 | - $this->item3,$this->item1 |
|
| 356 | + $this->item3, $this->item1 |
|
| 357 | 357 | ); |
| 358 | 358 | $this->list->mergeWith($array); |
| 359 | 359 | $this->assertTrue($this->list->getCount() == 4 && $this->list[0] === $this->item1 && $this->list[3] === $this->item1); |
@@ -408,33 +408,33 @@ discard block |
||
| 408 | 408 | public function testOffsetSetAddTList() |
| 409 | 409 | { |
| 410 | 410 | $list = new TPriorityList(array( |
| 411 | - 1,2,3 |
|
| 411 | + 1, 2, 3 |
|
| 412 | 412 | )); |
| 413 | 413 | $list->offsetSet(null, 4); |
| 414 | 414 | self::assertEquals(array( |
| 415 | - 1,2,3,4 |
|
| 415 | + 1, 2, 3, 4 |
|
| 416 | 416 | ), $list->toArray()); |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | public function testOffsetSetReplaceTList() |
| 420 | 420 | { |
| 421 | 421 | $list = new TPriorityList(array( |
| 422 | - 1,2,3 |
|
| 422 | + 1, 2, 3 |
|
| 423 | 423 | )); |
| 424 | 424 | $list->offsetSet(1, 4); |
| 425 | 425 | self::assertEquals(array( |
| 426 | - 1,4,3 |
|
| 426 | + 1, 4, 3 |
|
| 427 | 427 | ), $list->toArray()); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | public function testOffsetUnsetTList() |
| 431 | 431 | { |
| 432 | 432 | $list = new TPriorityList(array( |
| 433 | - 1,2,3 |
|
| 433 | + 1, 2, 3 |
|
| 434 | 434 | )); |
| 435 | 435 | $list->offsetUnset(1); |
| 436 | 436 | self::assertEquals(array( |
| 437 | - 1,3 |
|
| 437 | + 1, 3 |
|
| 438 | 438 | ), $list->toArray()); |
| 439 | 439 | } |
| 440 | 440 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | public function testConstructTPriorityList() |
| 450 | 450 | { |
| 451 | 451 | $a = array( |
| 452 | - 'a' => 1,'0.5' => 2,9 => 8 |
|
| 452 | + 'a' => 1, '0.5' => 2, 9 => 8 |
|
| 453 | 453 | ); |
| 454 | 454 | |
| 455 | 455 | $list = new TPriorityList($a); |
@@ -646,38 +646,38 @@ discard block |
||
| 646 | 646 | |
| 647 | 647 | $plist->insertAtIndexInPriority(4, false); |
| 648 | 648 | $this->assertEquals(array( |
| 649 | - 3,4 |
|
| 649 | + 3, 4 |
|
| 650 | 650 | ), $plist->toArray()); |
| 651 | 651 | $plist->insertAtIndexInPriority(5, 2); |
| 652 | 652 | $this->assertEquals(array( |
| 653 | - 3,4,5 |
|
| 653 | + 3, 4, 5 |
|
| 654 | 654 | ), $plist->toArray()); |
| 655 | 655 | |
| 656 | 656 | $plist->insertAtIndexInPriority(6, false, null); |
| 657 | 657 | $this->assertEquals(array( |
| 658 | - 3,4,5,6 |
|
| 658 | + 3, 4, 5, 6 |
|
| 659 | 659 | ), $plist->toArray()); |
| 660 | 660 | $plist->insertAtIndexInPriority(7, 5, null); |
| 661 | 661 | $this->assertEquals(array( |
| 662 | - 3,4,5,6,7 |
|
| 662 | + 3, 4, 5, 6, 7 |
|
| 663 | 663 | ), $plist->toArray()); |
| 664 | 664 | |
| 665 | 665 | $plist->insertAtIndexInPriority(8, false, 10); |
| 666 | 666 | $this->assertEquals(array( |
| 667 | - 3,4,5,6,7,8 |
|
| 667 | + 3, 4, 5, 6, 7, 8 |
|
| 668 | 668 | ), $plist->toArray()); |
| 669 | 669 | $plist->insertAtIndexInPriority(9, 7, 10); |
| 670 | 670 | $this->assertEquals(array( |
| 671 | - 3,4,5,6,7,8,9 |
|
| 671 | + 3, 4, 5, 6, 7, 8, 9 |
|
| 672 | 672 | ), $plist->toArray()); |
| 673 | 673 | |
| 674 | 674 | $plist->insertAtIndexInPriority(10, false, 100); |
| 675 | 675 | $this->assertEquals(array( |
| 676 | - 3,4,5,6,7,8,9,10 |
|
| 676 | + 3, 4, 5, 6, 7, 8, 9, 10 |
|
| 677 | 677 | ), $plist->toArray()); |
| 678 | 678 | $plist->insertAtIndexInPriority(11, 1, 100); |
| 679 | 679 | $this->assertEquals(array( |
| 680 | - 3,4,5,6,7,8,9,10,11 |
|
| 680 | + 3, 4, 5, 6, 7, 8, 9, 10, 11 |
|
| 681 | 681 | ), $plist->toArray()); |
| 682 | 682 | |
| 683 | 683 | $plist = new TPriorityList(); |
@@ -689,38 +689,38 @@ discard block |
||
| 689 | 689 | |
| 690 | 690 | $plist->insertAtIndexInPriority(4, false, null, true); |
| 691 | 691 | $this->assertEquals(array( |
| 692 | - 3,4 |
|
| 692 | + 3, 4 |
|
| 693 | 693 | ), $plist->toArray()); |
| 694 | 694 | $plist->insertAtIndexInPriority(5, 2, null, true); |
| 695 | 695 | $this->assertEquals(array( |
| 696 | - 3,4,5 |
|
| 696 | + 3, 4, 5 |
|
| 697 | 697 | ), $plist->toArray()); |
| 698 | 698 | |
| 699 | 699 | $plist->insertAtIndexInPriority(6, false, null, true); |
| 700 | 700 | $this->assertEquals(array( |
| 701 | - 3,4,5,6 |
|
| 701 | + 3, 4, 5, 6 |
|
| 702 | 702 | ), $plist->toArray()); |
| 703 | 703 | $plist->insertAtIndexInPriority(7, 5, null, true); |
| 704 | 704 | $this->assertEquals(array( |
| 705 | - 3,4,5,6,7 |
|
| 705 | + 3, 4, 5, 6, 7 |
|
| 706 | 706 | ), $plist->toArray()); |
| 707 | 707 | |
| 708 | 708 | $plist->insertAtIndexInPriority(8, false, 10, true); |
| 709 | 709 | $this->assertEquals(array( |
| 710 | - 3,4,5,6,7,8 |
|
| 710 | + 3, 4, 5, 6, 7, 8 |
|
| 711 | 711 | ), $plist->toArray()); |
| 712 | 712 | $plist->insertAtIndexInPriority(9, 7, 10, true); |
| 713 | 713 | $this->assertEquals(array( |
| 714 | - 3,4,5,6,7,8,9 |
|
| 714 | + 3, 4, 5, 6, 7, 8, 9 |
|
| 715 | 715 | ), $plist->toArray()); |
| 716 | 716 | |
| 717 | 717 | $plist->insertAtIndexInPriority(10, false, 100, true); |
| 718 | 718 | $this->assertEquals(array( |
| 719 | - 3,4,5,6,7,8,9,10 |
|
| 719 | + 3, 4, 5, 6, 7, 8, 9, 10 |
|
| 720 | 720 | ), $plist->toArray()); |
| 721 | 721 | $plist->insertAtIndexInPriority(11, 1, 100, true); |
| 722 | 722 | $this->assertEquals(array( |
| 723 | - 3,4,5,6,7,8,9,10,11 |
|
| 723 | + 3, 4, 5, 6, 7, 8, 9, 10, 11 |
|
| 724 | 724 | ), $plist->toArray()); |
| 725 | 725 | |
| 726 | 726 | $plist = new TPriorityList(); |
@@ -732,38 +732,38 @@ discard block |
||
| 732 | 732 | |
| 733 | 733 | $plist->insertAtIndexInPriority(4, false, null, false); |
| 734 | 734 | $this->assertEquals(array( |
| 735 | - 3,4 |
|
| 735 | + 3, 4 |
|
| 736 | 736 | ), $plist->toArray()); |
| 737 | 737 | $plist->insertAtIndexInPriority(5, 2, null, false); |
| 738 | 738 | $this->assertEquals(array( |
| 739 | - 3,4,5 |
|
| 739 | + 3, 4, 5 |
|
| 740 | 740 | ), $plist->toArray()); |
| 741 | 741 | |
| 742 | 742 | $plist->insertAtIndexInPriority(6, false, null, false); |
| 743 | 743 | $this->assertEquals(array( |
| 744 | - 3,4,5,6 |
|
| 744 | + 3, 4, 5, 6 |
|
| 745 | 745 | ), $plist->toArray()); |
| 746 | 746 | $plist->insertAtIndexInPriority(7, 5, null, false); |
| 747 | 747 | $this->assertEquals(array( |
| 748 | - 3,4,5,6,7 |
|
| 748 | + 3, 4, 5, 6, 7 |
|
| 749 | 749 | ), $plist->toArray()); |
| 750 | 750 | |
| 751 | 751 | $plist->insertAtIndexInPriority(8, false, 10, false); |
| 752 | 752 | $this->assertEquals(array( |
| 753 | - 3,4,5,6,7,8 |
|
| 753 | + 3, 4, 5, 6, 7, 8 |
|
| 754 | 754 | ), $plist->toArray()); |
| 755 | 755 | $plist->insertAtIndexInPriority(9, 7, 10, false); |
| 756 | 756 | $this->assertEquals(array( |
| 757 | - 3,4,5,6,7,8,9 |
|
| 757 | + 3, 4, 5, 6, 7, 8, 9 |
|
| 758 | 758 | ), $plist->toArray()); |
| 759 | 759 | |
| 760 | 760 | $plist->insertAtIndexInPriority(10, false, 100, false); |
| 761 | 761 | $this->assertEquals(array( |
| 762 | - 3,4,5,6,7,8,9,10 |
|
| 762 | + 3, 4, 5, 6, 7, 8, 9, 10 |
|
| 763 | 763 | ), $plist->toArray()); |
| 764 | 764 | $plist->insertAtIndexInPriority(11, 1, 100, false); |
| 765 | 765 | $this->assertEquals(array( |
| 766 | - 3,4,5,6,7,8,9,10,11 |
|
| 766 | + 3, 4, 5, 6, 7, 8, 9, 10, 11 |
|
| 767 | 767 | ), $plist->toArray()); |
| 768 | 768 | } |
| 769 | 769 | |
@@ -921,7 +921,7 @@ discard block |
||
| 921 | 921 | public function testMergeWithTPriorityList() |
| 922 | 922 | { |
| 923 | 923 | $plist = new TPriorityList(array( |
| 924 | - $this->item3,$this->item1 |
|
| 924 | + $this->item3, $this->item1 |
|
| 925 | 925 | )); |
| 926 | 926 | $plist->mergeWith($this->plist); |
| 927 | 927 | $this->assertEquals(6, $plist->getCount()); |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | $list->add(3, 15); |
| 1088 | 1088 | $list->offsetSet(null, 4); // Appending like this, items get the default priority; not linear behavior |
| 1089 | 1089 | self::assertEquals(array( |
| 1090 | - 1,2,4,3 |
|
| 1090 | + 1, 2, 4, 3 |
|
| 1091 | 1091 | ), $list->toArray()); |
| 1092 | 1092 | } |
| 1093 | 1093 | |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | $list->add(3, 15); |
| 1100 | 1100 | $list->offsetSet(1, 4); |
| 1101 | 1101 | self::assertEquals(array( |
| 1102 | - 1,4,3 |
|
| 1102 | + 1, 4, 3 |
|
| 1103 | 1103 | ), $list->toArray()); |
| 1104 | 1104 | } |
| 1105 | 1105 | |
@@ -1111,7 +1111,7 @@ discard block |
||
| 1111 | 1111 | $list->add(3, 15); |
| 1112 | 1112 | $list->offsetSet(3, 4); |
| 1113 | 1113 | self::assertEquals(array( |
| 1114 | - 1,2,3,4 |
|
| 1114 | + 1, 2, 3, 4 |
|
| 1115 | 1115 | ), $list->toArray()); |
| 1116 | 1116 | } |
| 1117 | 1117 | |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | $list->add(3, 15); |
| 1124 | 1124 | $list->offsetUnset(1); |
| 1125 | 1125 | self::assertEquals(array( |
| 1126 | - 1,3 |
|
| 1126 | + 1, 3 |
|
| 1127 | 1127 | ), $list->toArray()); |
| 1128 | 1128 | } |
| 1129 | 1129 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $list = new TPagedList(); |
| 64 | 64 | try { |
| 65 | 65 | $list->PageSize = 0; |
| 66 | - } catch(TInvalidDataValueException $e) { |
|
| 66 | + } catch (TInvalidDataValueException $e) { |
|
| 67 | 67 | return; |
| 68 | 68 | } |
| 69 | 69 | self::fail('An expected TInvalidDataValueException was not raised'); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $myList = new MyPagedList(); |
| 97 | 97 | $list->attachEventHandler('OnFetchData', array($myList, 'fetchData')); |
| 98 | 98 | self::assertEquals(false, $myList->hasFetchedData()); |
| 99 | - $list->onFetchData(new TPagedListFetchDataEventParameter($list->CurrentPageIndex, $list->PageSize*$list->CurrentPageIndex, $list->PageSize)); |
|
| 99 | + $list->onFetchData(new TPagedListFetchDataEventParameter($list->CurrentPageIndex, $list->PageSize * $list->CurrentPageIndex, $list->PageSize)); |
|
| 100 | 100 | self::assertEquals(true, $myList->hasFetchedData()); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -174,13 +174,13 @@ discard block |
||
| 174 | 174 | self::assertInstanceOf('ArrayIterator', $list->getIterator()); |
| 175 | 175 | $n = 0; |
| 176 | 176 | $found = 0; |
| 177 | - foreach($list as $index => $item) { |
|
| 178 | - foreach($list as $a => $b); // test of iterator |
|
| 177 | + foreach ($list as $index => $item) { |
|
| 178 | + foreach ($list as $a => $b); // test of iterator |
|
| 179 | 179 | $n++; |
| 180 | - if($index === 0 && $item === 1) { |
|
| 180 | + if ($index === 0 && $item === 1) { |
|
| 181 | 181 | $found++; |
| 182 | 182 | } |
| 183 | - if($index === 1 && $item === 2) { |
|
| 183 | + if ($index === 1 && $item === 2) { |
|
| 184 | 184 | $found++; |
| 185 | 185 | } |
| 186 | 186 | } |