com php-src: cleanup: tests/run-tests.php

From: Date: Thu, 05 Dec 2013 22:50:26 +0000
Subject: com php-src: cleanup: tests/run-tests.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-75291@lists.php.net to get a copy of this message
Commit: 68176830273ec789383f39c2be4a123fb51cdd46 Author: krakjoe <joe.watkins@live.co.uk> Thu, 5 Dec 2013 22:50:26 +0000 Parents: 3108b28dc1325b439a1f194ddba5ffa249ed32ee Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=68176830273ec789383f39c2be4a123fb51cdd46 Log: cleanup Changed paths: M tests/run-tests.php Diff: diff --git a/tests/run-tests.php b/tests/run-tests.php index 139ff93..71f7231 100644 --- a/tests/run-tests.php +++ b/tests/run-tests.php @@ -1,6 +1,12 @@ <?php namespace phpdbg\testing { - + + /* + * Workaround ... + */ + if (!defined('DIR_SEP')) + define('DIR_SEP', '\\' . DIRECTORY_SEPARATOR); + /** * TestConfigurationExceptions are thrown * when the configuration prohibits tests executing @@ -303,6 +309,42 @@ namespace phpdbg\testing { * Formatted output */ const FORMAT = 0x00001000; + + /** + * Format specifiers + */ + private static $format = array( + 'search' => array( + '%e', + '%s', + '%S', + '%a', + '%A', + '%w', + '%i', + '%d', + '%x', + '%f', + '%c', + '%t', + '$T' + ), + 'replace' => array( + DIR_SEP, + '[^\r\n]+', + '[^\r\n]*', + '.+', + '.*', + '\s*', + '[+-]?\d+', + '\d+', + '[0-9a-fA-F]+', + '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', + '.', + '\t', + '\t+' + ) + ); /** * Constructs a new Test object given a specilized phpdbginit file @@ -356,35 +398,9 @@ namespace phpdbg\testing { switch ($this->expect) { case TEST::FORMAT: - $this->match[] = str_replace(array( - '%e', - '%s', - '%S', - '%a', - '%A', - '%w', - '%i', - '%d', - '%x', - '%f', - '%c', - '%t', - '$T' - ), array( - '\\' . DIRECTORY_SEPARATOR, - '[^\r\n]+', - '[^\r\n]*', - '.+', - '.*', - '\s*', - '[+-]?\d+', - '\d+', - '[0-9a-fA-F]+', - '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', - '.', - '\t', - '\t+' - ), preg_quote($line)); + $this->match[] = str_replace( + self::$format['search'], + self::$format['replace'], preg_quote($line)); break; default: $this->match[] = $line;

« previous php.cvs (#75291) next »