diff --git a/Zend/bench.php b/Zend/bench.php index 818ce5fbafbc2..8fc234217dade 100644 --- a/Zend/bench.php +++ b/Zend/bench.php @@ -5,18 +5,18 @@ function simple() { $a = 0; - for ($i = 0; $i < 1000000; $i++) + for ($i = 0; $i < 1000000; $i++) $a++; $thisisanotherlongname = 0; - for ($thisisalongname = 0; $thisisalongname < 1000000; $thisisalongname++) + for ($thisisalongname = 0; $thisisalongname < 1000000; $thisisalongname++) $thisisanotherlongname++; } /****/ function simplecall() { - for ($i = 0; $i < 1000000; $i++) + for ($i = 0; $i < 1000000; $i++) strlen("hallo"); } @@ -26,14 +26,14 @@ function hallo($a) { } function simpleucall() { - for ($i = 0; $i < 1000000; $i++) + for ($i = 0; $i < 1000000; $i++) hallo("hallo"); } /****/ function simpleudcall() { - for ($i = 0; $i < 1000000; $i++) + for ($i = 0; $i < 1000000; $i++) hallo2("hallo"); } diff --git a/Zend/micro_bench.php b/Zend/micro_bench.php index 70525882ebad9..ef6dd4f7b21d7 100644 --- a/Zend/micro_bench.php +++ b/Zend/micro_bench.php @@ -4,12 +4,12 @@ function hallo() { } function simpleucall($n) { - for ($i = 0; $i < $n; $i++) + for ($i = 0; $i < $n; $i++) hallo(); } function simpleudcall($n) { - for ($i = 0; $i < $n; $i++) + for ($i = 0; $i < $n; $i++) hallo2(); } @@ -17,7 +17,7 @@ function hallo2() { } function simpleicall($n) { - for ($i = 0; $i < $n; $i++) + for ($i = 0; $i < $n; $i++) func_num_args(); } diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 5d5f734a23ad9..e475c50ae1c3a 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -1267,7 +1267,7 @@ function gen_labels($f, $spec, $kind, $prolog, &$specs, $switch_labels = array() $label++; return; } - + // Emit pointer to specialized handler $spec_name = $dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2].extra_spec_name($extra_spec); switch ($kind) { @@ -1942,7 +1942,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) "# endif\n" . $m[1]."return;\n" . "#else\n" . - $m[1]."if (EXPECTED(ret > 0)) {\n" . + $m[1]."if (EXPECTED(ret > 0)) {\n" . $m[1]."\texecute_data = EG(current_execute_data);\n". $m[1]."\tZEND_VM_LOOP_INTERRUPT_CHECK();\n". $m[1]."} else {\n" . @@ -2351,7 +2351,7 @@ function gen_vm($def, $skel) { fputs($f, "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode);\n"); fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode);\n\n"); fputs($f, "END_EXTERN_C()\n\n"); - + foreach ($opcodes as $code => $dsc) { $code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT); $op = str_pad($dsc["op"],$max_opcode_len); @@ -2375,13 +2375,13 @@ function gen_vm($def, $skel) { out($f, HEADER_TEXT); fputs($f,"#include \n"); fputs($f,"#include \n\n"); - + fputs($f,"static const char *zend_vm_opcodes_names[".($max_opcode + 1)."] = {\n"); for ($i = 0; $i <= $max_opcode; $i++) { fputs($f,"\t".(isset($opcodes[$i]["op"])?'"'.$opcodes[$i]["op"].'"':"NULL").",\n"); } fputs($f, "};\n\n"); - + fputs($f,"static uint32_t zend_vm_opcodes_flags[".($max_opcode + 1)."] = {\n"); for ($i = 0; $i <= $max_opcode; $i++) { fprintf($f, "\t0x%08x,\n", isset($opcodes[$i]["flags"]) ? $opcodes[$i]["flags"] : 0); @@ -2395,7 +2395,7 @@ function gen_vm($def, $skel) { fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode) {\n"); fputs($f, "\treturn zend_vm_opcodes_flags[opcode];\n"); fputs($f, "}\n"); - + fclose($f); echo "zend_vm_opcodes.c generated successfully.\n"; @@ -2426,7 +2426,7 @@ function gen_vm($def, $skel) { out($f, "# pragma warning(once : 6326)\n"); } out($f, "#endif\n"); - + // Support for ZEND_USER_OPCODE out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n"); for ($i = 0; $i < 255; ++$i) { diff --git a/ext/curl/tests/responder/get.php b/ext/curl/tests/responder/get.php index 60aafc03d41dd..f9269745f6111 100644 --- a/ext/curl/tests/responder/get.php +++ b/ext/curl/tests/responder/get.php @@ -21,7 +21,7 @@ echo $_COOKIE['foo']; break; case 'encoding': - echo $_SERVER['HTTP_ACCEPT_ENCODING']; + echo $_SERVER['HTTP_ACCEPT_ENCODING']; break; case 'contenttype': header('Content-Type: text/plain;charset=utf-8'); diff --git a/ext/dom/tests/domdocumentload_utilities.php b/ext/dom/tests/domdocumentload_utilities.php index efd1e5a1a52bc..d40f7639ff82f 100644 --- a/ext/dom/tests/domdocumentload_utilities.php +++ b/ext/dom/tests/domdocumentload_utilities.php @@ -1,13 +1,13 @@ loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')), +$result = $doc->loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')), $libxml_options); $expectedResult = (bool) getenv('EXPECTED_RESULT'); diff --git a/ext/dom/tests/domdocumentloadxml_test_method_savexml.php b/ext/dom/tests/domdocumentloadxml_test_method_savexml.php index 1ef72d58d762c..1bcf8a8e33b11 100644 --- a/ext/dom/tests/domdocumentloadxml_test_method_savexml.php +++ b/ext/dom/tests/domdocumentloadxml_test_method_savexml.php @@ -4,7 +4,7 @@ $doc = new DOMDocument(); $libxml_options = libxml_options_to_int(getenv('LOAD_OPTIONS')); -$result = $doc->loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')), +$result = $doc->loadXML(file_get_contents(dirname(__FILE__) . getenv('XML_FILE')), $libxml_options); $expectedResult = (bool) getenv('EXPECTED_RESULT'); diff --git a/ext/ext_skel.php b/ext/ext_skel.php index b5e3aad0a9b18..42cde92621893 100644 --- a/ext/ext_skel.php +++ b/ext/ext_skel.php @@ -91,13 +91,13 @@ function print_success() { */ function process_args($argv, $argc) { $options = [ - 'unix' => true, - 'windows' => true, - 'ext' => '', - 'dir' => __DIR__ . DIRECTORY_SEPARATOR, - 'skel' => __DIR__ . DIRECTORY_SEPARATOR . 'skeleton' . DIRECTORY_SEPARATOR, - 'author' => false, - 'experimental' => false, + 'unix' => true, + 'windows' => true, + 'ext' => '', + 'dir' => __DIR__ . DIRECTORY_SEPARATOR, + 'skel' => __DIR__ . DIRECTORY_SEPARATOR . 'skeleton' . DIRECTORY_SEPARATOR, + 'author' => false, + 'experimental' => false, 'std' => false ]; @@ -271,7 +271,7 @@ function copy_sources() { global $options; $files = [ - 'skeleton.c' => $options['ext'] . '.c', + 'skeleton.c' => $options['ext'] . '.c', 'php_skeleton.h' => 'php_' . $options['ext'] . '.h' ]; diff --git a/ext/hash/bench.php b/ext/hash/bench.php index a433af0178a86..280190f767b74 100644 --- a/ext/hash/bench.php +++ b/ext/hash/bench.php @@ -3,7 +3,7 @@ /* This gives rather interesting results :) - + Measures on a Notebook P4M-1.7 256MB Windows 2000: sha1 0.556691 tiger160,3 0.774469 diff --git a/ext/intl/doc/collator_api.php b/ext/intl/doc/collator_api.php index ef7250243bfdd..8005aca2ca644 100644 --- a/ext/intl/doc/collator_api.php +++ b/ext/intl/doc/collator_api.php @@ -324,7 +324,7 @@ function collator_sort_with_sort_keys( $coll, $arr ) {} * Get the locale name of the collator. * * @param Collator $coll Collator object. - * @param int $type You can choose between valid and + * @param int $type You can choose between valid and * actual locale * (ULOC_VALID_LOCALE, ULOC_ACTUAL_LOCALE * respectively). diff --git a/ext/intl/doc/datefmt_api.php b/ext/intl/doc/datefmt_api.php index 6beb243863567..2dba59df63beb 100644 --- a/ext/intl/doc/datefmt_api.php +++ b/ext/intl/doc/datefmt_api.php @@ -4,9 +4,9 @@ * Date Formatter class - locale-dependent formatting/parsing of dates using pattern strings and/or canned patterns. * * This class represents the ICU date formatting functionality. It allows users to - * display dates in a localized format or to parse strings + * display dates in a localized format or to parse strings * into PHP date values using pattern strings and/or canned patterns. - * + * * Example: * * $datefmt = new DateFormatter("de-DE", LONG, SHORT, date_default_timezone_get()); @@ -38,19 +38,19 @@ class DateFormatter { const SHORT = 3; /** - * The following int constants are used to specify the calendar. - * These calendars are all based directly on the Gregorian calendar - * Non-Gregorian calendars need to be specified in locale. + * The following int constants are used to specify the calendar. + * These calendars are all based directly on the Gregorian calendar + * Non-Gregorian calendars need to be specified in locale. * Examples might include locale="hi@calendar=BUDDHIST" */ const TRADITIONAL = 0; // non-Gregorian calendar that is locale-defined, required by ICU const GREGORIAN = 1 ;// Gregorian calendar - + ############################################################################# # Object-oriented API ############################################################################# /** - * Create a date formatter + * Create a date formatter * * @param string $locale Locale to use when formatting or parsing * @param integer $datetype Date type to use (none, short, medium, long, full) @@ -66,7 +66,7 @@ class DateFormatter { public function __construct($locale, $datetype, $timetype, $timezone = null, $calendar= null , $pattern= null) {} /** - * Create a date formatter + * Create a date formatter * * @param string $locale Locale to use when formatting or parsing * @param integer $datetype Date type to use (none, short, medium, long, full) @@ -86,7 +86,7 @@ public static function create($locale, $datetype, $timetype, $timezone = null, $ * @param mixed $value - value to format * integer: a unix timestamp value (seconds since epoch, UTC) * array: a localtime array - uses 24 hour clock in tm_hour field - * @return string a formatted string or, if an error occurred, 'null'. + * @return string a formatted string or, if an error occurred, 'null'. */ public function format($value) {} @@ -96,7 +96,7 @@ public function format($value) {} * $parse_pos and consuming as much of the input value as possible * If no error occurs before $value is consumed, $parse_pos will contain -1 * otherwise it will contain the position at which parsing ended (and the error - * occurred). + * occurred). * @param string $value string to convert to a time * @param integer $parse_pos position at which to start the parsing in $value (zero-based) * This variable will contain the end position if the parse fails @@ -105,13 +105,13 @@ public function format($value) {} */ public function parse($value, $parse_pos=0) {} - + /** * converts string $value to a field-based time value, starting at * $parse_pos and consuming as much of the input value as possible * If no error occurs before $value is consumed, $parse_pos will contain -1 * otherwise it will contain the position at which parsing ended (and the error - * occurred). + * occurred). * @param string $value string to convert to a time * @param integer $parse_pos position at which to start the parsing in $value (zero-based) * This variable will contain the end position if the parse fails @@ -122,21 +122,21 @@ public function localtime($value, $parse_pos=0) {} /** - * Gets the datetype in use + * Gets the datetype in use * @return integer the current 'datetype' value of the formatter */ public function getDateType() {} /** - * Gets the timetype in use + * Gets the timetype in use * @return integer the current 'timetype' value of the formatter */ public function getTimeType() {} /** - * Gets the leniency in use + * Gets the leniency in use * @return boolean 'true' if parser is lenient, 'false' if parser is strict * default value for parser is 'false'. */ @@ -144,22 +144,22 @@ public function isLenient() {} /** - * Sets the leniency to use + * Sets the leniency to use * @param boolean $lenient sets whether the parser is lenient or not, default is 'false' - * 'true' sets the parser to accept otherwise flawed date or + * 'true' sets the parser to accept otherwise flawed date or * time patterns, parsing as much as possible to obtain a value. - * 'false' sets the parser to strictly parse strings into dates. - * Extra space, unrecognized tokens, or invalid values + * 'false' sets the parser to strictly parse strings into dates. + * Extra space, unrecognized tokens, or invalid values * ("February 30th") are not accepted. * - * @return boolean 'true' if successful; 'false' if an error occurred. + * @return boolean 'true' if successful; 'false' if an error occurred. */ public function setLenient($lenient) {} /** - * Gets the locale in use - * @param [integer] which locale should be returned? + * Gets the locale in use + * @param [integer] which locale should be returned? * values may include ULOC_ACTUAL_LOCALE, * ULOC_VALID_LOCALE. By default the actual * locale is returned. @@ -187,33 +187,33 @@ public function setTimeZoneId($zone) {} /** - * Sets the calendar used to the appropriate calendar, which must be + * Sets the calendar used to the appropriate calendar, which must be * one of the constants defined above. Some examples include: * - Gregorian calendar * - Traditional * Default value is GREGORIAN * @param integer $which the calendar (an enumerated constant) to use. - * @return boolean 'true' if successful, 'false' if an error occurred or if the calendar was not recognized + * @return boolean 'true' if successful, 'false' if an error occurred or if the calendar was not recognized */ public function setCalendar($which) {} /** - * Gets the Calendar in use + * Gets the Calendar in use * @return integer the calendar being used by the formatter */ public function getCalendar() {} /** - * Gets the pattern in use - * @return string the pattern string being used to format/parse + * Gets the pattern in use + * @return string the pattern string being used to format/parse */ public function getPattern() {} /** - * Sets the pattern to use + * Sets the pattern to use * @param string $pattern new pattern string to use * @return boolean 'true' if successful, 'false' if an error occurred. Bad format * strings are usually the cause of the latter. @@ -247,7 +247,7 @@ public function getErrorMessage() {} /** - * Create a date formatter + * Create a date formatter * * @param string $locale Locale to use when formatting or parsing * @param integer $datetype Date type to use (none, short, medium, long, full) @@ -268,7 +268,7 @@ function datefmt_create($locale, $datetype, $timetype, $timezone = null, $calend * @param mixed $value - value to format * integer: a unix timestamp value (seconds since epoch, UTC) * array: a localtime array - uses 24 hour clock in tm_hour field - * @return string a formatted string or, if an error occurred, 'null'. + * @return string a formatted string or, if an error occurred, 'null'. */ function datefmt_format($fmt , $value) {} @@ -278,7 +278,7 @@ function datefmt_format($fmt , $value) {} * $parse_pos and consuming as much of the input value as possible * If no error occurs before $value is consumed, $parse_pos will contain -1 * otherwise it will contain the position at which parsing ended (and the error - * occurred). + * occurred). * @param DateFormatter $fmt The date formatter resource * @param string $value string to convert to a time * @param integer $parse_pos position at which to start the parsing in $value (zero-based) @@ -288,13 +288,13 @@ function datefmt_format($fmt , $value) {} */ function datefmt_parse($fmt , $value, $parse_pos=0) {} - + /** * converts string $value to a field-based time value, starting at * $parse_pos and consuming as much of the input value as possible * If no error occurs before $value is consumed, $parse_pos will contain -1 * otherwise it will contain the position at which parsing ended (and the error - * occurred). + * occurred). * @param DateFormatter $fmt The date formatter resource * @param string $value string to convert to a time * @param integer $parse_pos position at which to start the parsing in $value (zero-based) @@ -322,7 +322,7 @@ function datefmt_get_timetype($fmt) {} /** - * Gets the leniency of the formatter + * Gets the leniency of the formatter * @param DateFormatter $fmt The date formatter resource * @return boolean 'true' if parser is lenient, 'false' if parser is strict * default value for parser is 'false'. @@ -331,16 +331,16 @@ function datefmt_is_lenient($fmt) {} /** - * Sets the leniency of the formatter + * Sets the leniency of the formatter * @param DateFormatter $fmt The date formatter resource * @param boolean $lenient sets whether the parser is lenient or not, default is 'false' - * 'true' sets the parser to accept otherwise flawed date or + * 'true' sets the parser to accept otherwise flawed date or * time patterns, parsing as much as possible to obtain a value. - * 'false' sets the parser to strictly parse strings into dates. - * Extra space, unrecognized tokens, or invalid values + * 'false' sets the parser to strictly parse strings into dates. + * Extra space, unrecognized tokens, or invalid values * ("February 30th") are not accepted. * - * @return boolean 'true' if successful; 'false' if an error occurred. + * @return boolean 'true' if successful; 'false' if an error occurred. */ function datefmt_set_lenient($fmt , $lenient) {} @@ -348,7 +348,7 @@ function datefmt_set_lenient($fmt , $lenient) {} /** * Gets the locale in use * @param DateFormatter $fmt The date formatter resource - * @param [integer] which locale should be returned? + * @param [integer] which locale should be returned? * values may include ULOC_ACTUAL_LOCALE, * ULOC_VALID_LOCALE. By default the actual * locale is returned. @@ -366,14 +366,14 @@ function datefmt_get_timezone_id($fmt) {} /** - * Sets the calendar used to the appropriate calendar, which must be + * Sets the calendar used to the appropriate calendar, which must be * one of the constants defined above. Some examples include: * - Gregorian calendar * - Traditional * Default value is GREGORIAN * @param DateFormatter $fmt The date formatter resource * @param integer $which the calendar (an enumerated constant) to use. - * @return boolean 'true' if successful, 'false' if an error occurred or if the calendar was not recognized + * @return boolean 'true' if successful, 'false' if an error occurred or if the calendar was not recognized */ function datefmt_set_calendar($fmt , $which) {} diff --git a/ext/intl/doc/grapheme_api.php b/ext/intl/doc/grapheme_api.php index e22d165cbbcda..91f4869166d3c 100644 --- a/ext/intl/doc/grapheme_api.php +++ b/ext/intl/doc/grapheme_api.php @@ -30,14 +30,14 @@ function grapheme_strlen($input) {} * Find position (in grapheme units) of first occurrence of a string * @param string $haystack The string to look in * @param string $needle The string to look for - * @param [int] $offset The optional offset parameter allows you to specify - which character in haystack to start searching. The position + * @param [int] $offset The optional offset parameter allows you to specify + which character in haystack to start searching. The position returned is still relative to the beginning of haystack. * @return int Returns the position as an integer. If needle is not found, strpos() will return boolean FALSE. */ function grapheme_strpos($haystack, $needle, $offset = 0) {} - + /** * Find position (in grapheme units) of first occurrence of a case-insensitive string * @param string $haystack The string to look in @@ -48,7 +48,7 @@ function grapheme_strpos($haystack, $needle, $offset = 0) {} * @return int Returns the position as an integer. If needle is not found, grapheme_stripos() will return boolean FALSE. */ function grapheme_stripos($haystack, $needle, $offset = 0) {} - + /** * Find position (in grapheme units) of last occurrence of a string @@ -77,12 +77,12 @@ function grapheme_strripos($haystack, $needle, $offset = 0) {} /** * Return part of a string * @param string $string The input string. - * @param int $start If start is non-negative, the returned string will start at the + * @param int $start If start is non-negative, the returned string will start at the start'th position in string, counting from zero. If start is negative, - the returned string will start at the start'th character from the + the returned string will start at the start'th character from the end of string. * @param [int] $length If length is given and is positive, the string returned will contain - at most length characters beginning from start (depending on the + at most length characters beginning from start (depending on the length of string). If string is less than or equal to start characters long, FALSE will be returned. If length is given and is negative, then that many characters will be omitted from the end of string (after the @@ -122,7 +122,7 @@ function grapheme_stristr($haystack, $needle, $before_needle = FALSE) {} * @param [int] $extract_type one of GRAPHEME_EXTR_COUNT (default), GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS * @param [int] $start starting position in $haystack in bytes * @param [&int] $next set to next starting position in bytes - * @return string A string starting at offset $start containing no more than $size grapheme clusters + * @return string A string starting at offset $start containing no more than $size grapheme clusters and ending on a default grapheme cluster boundary. */ function grapheme_extract($haystack, $size, $extract_type = GRAPHEME_EXTR_COUNT, $start = 0, &$next) {} diff --git a/ext/intl/doc/locale_api.php b/ext/intl/doc/locale_api.php index c6c41ede0ab41..4633ac122797b 100644 --- a/ext/intl/doc/locale_api.php +++ b/ext/intl/doc/locale_api.php @@ -1,29 +1,29 @@ $state) { echo "#ifdef $code\n"; @@ -23,5 +23,5 @@ echo "#endif\n"; } - + ?> diff --git a/ext/pgsql/mysql_users.php b/ext/pgsql/mysql_users.php index edfaa1cddcce3..44d4f1b66d6a7 100644 --- a/ext/pgsql/mysql_users.php +++ b/ext/pgsql/mysql_users.php @@ -2,7 +2,7 @@ /* * File: mysql_users.php * Author: Yasuo Ohgaki - * + * * This file contains example user defined functions that does * similar to MySQL functions. They can be implemented as module * functions, but there won't be many users need them. @@ -12,11 +12,11 @@ /* * mysql_list_dbs() - * - * This function should be needed, since PostgreSQL connection + * + * This function should be needed, since PostgreSQL connection * binds database. */ -function pg_list_dbs($db) +function pg_list_dbs($db) { assert(is_resource($db)); $query = ' @@ -24,7 +24,7 @@ function pg_list_dbs($db) d.datname as "Name", u.usename as "Owner", pg_encoding_to_char(d.encoding) as "Encoding" -FROM +FROM pg_database d LEFT JOIN pg_user u ON d.datdba = u.usesysid ORDER BY 1; '; @@ -35,7 +35,7 @@ function pg_list_dbs($db) /* * mysql_list_tables() */ -function pg_list_tables($db) +function pg_list_tables($db) { assert(is_resource($db)); $query = " @@ -58,7 +58,7 @@ function pg_list_tables($db) * * See also pg_meta_data(). It returns field definition as array. */ -function pg_list_fields($db, $table) +function pg_list_fields($db, $table) { assert(is_resource($db)); $query = " diff --git a/ext/phar/shortarc.php b/ext/phar/shortarc.php index e5ac8bab6d90c..2c1f40dfe49b7 100644 --- a/ext/phar/shortarc.php +++ b/ext/phar/shortarc.php @@ -127,7 +127,7 @@ static function go($return = false) } while (strlen($last) && strlen($m) < $L[1]); if (strlen($m) < $L[1]) { - die('ERROR: manifest length read was "' . + die('ERROR: manifest length read was "' . strlen($m) .'" should be "' . $L[1] . '"'); } diff --git a/ext/phar/tests/files/pear2coverage.phar.php b/ext/phar/tests/files/pear2coverage.phar.php index 621b0d07f8de1..f3e488a67840a 100644 Binary files a/ext/phar/tests/files/pear2coverage.phar.php and b/ext/phar/tests/files/pear2coverage.phar.php differ diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php index 009e1f0409ddc..2c3eecae6eda0 100644 --- a/ext/soap/interop/client_round2_interop.php +++ b/ext/soap/interop/client_round2_interop.php @@ -200,7 +200,7 @@ function _getEndpoints($base = "", $all = 0) { } else if (!$all) $sql .= "where status=1"; $sql .= " order by endpointName"; - + $db_ep = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC ); if (DB::isError($db_ep)) { @@ -263,7 +263,7 @@ function _saveResults($endpoint_id, &$soap_test) { $success = $result['fault']->faultcode; $pos = strpos($success,':'); if ($pos !== false) { - $success = substr($success,$pos+1); + $success = substr($success,$pos+1); } $error = $result['fault']->faultstring; if (!$wire) $wire= $result['fault']->detail; @@ -452,7 +452,7 @@ function doEndpointMethod(&$endpoint_info, &$soap_test) { // compare header results $headers_ok = TRUE; if ($soap_test->headers || $soap_test->headers_expect) { - $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers); + $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers); } # we need to decode what we sent so we can compare! @@ -514,7 +514,7 @@ function doEndpointMethod(&$endpoint_info, &$soap_test) { $res =$fault->faultcode; $pos = strpos($res,':'); if ($pos !== false) { - $res = substr($res,$pos+1); + $res = substr($res,$pos+1); } } // save the wire diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php index ccf479a5ccee4..dc1ab42f844be 100644 --- a/ext/soap/interop/client_round2_params.php +++ b/ext/soap/interop/client_round2_params.php @@ -109,7 +109,7 @@ function showTestResult($debug = 0, $html = 0) { $res = $fault->faultcode; $pos = strpos($res,':'); if ($pos !== false) { - $res = substr($res,$pos+1); + $res = substr($res,$pos+1); } if ($html) { print "FAILED: [$res] {$fault->faultstring}\n"; diff --git a/ext/spl/examples/dba_array.php b/ext/spl/examples/dba_array.php index 346ac1f2f7ae1..f217c34546750 100755 --- a/ext/spl/examples/dba_array.php +++ b/ext/spl/examples/dba_array.php @@ -11,7 +11,7 @@ * If \ is specified then \ is set to \ in \. * Else the value of \ is printed only. * - * Note: configure with --enable-dba + * Note: configure with --enable-dba */ if ($argc < 4) { diff --git a/ext/spl/examples/dba_dump.php b/ext/spl/examples/dba_dump.php index 2c698d427a175..7ea8e762552b0 100755 --- a/ext/spl/examples/dba_dump.php +++ b/ext/spl/examples/dba_dump.php @@ -11,7 +11,7 @@ * Show all groups in the ini file specified by \. * The regular expression \ is used to filter the by setting name. * - * Note: configure with --enable-dba + * Note: configure with --enable-dba */ if ($argc < 3) { diff --git a/ext/spl/examples/findregex.php b/ext/spl/examples/findregex.php index b43ee0cbbc169..288c0924b14f0 100755 --- a/ext/spl/examples/findregex.php +++ b/ext/spl/examples/findregex.php @@ -1,5 +1,5 @@ getPathname()."\n"; } -?> \ No newline at end of file +?> \ No newline at end of file diff --git a/ext/spl/examples/ini_groups.php b/ext/spl/examples/ini_groups.php index 51369110962ac..4c6c89bd70df6 100755 --- a/ext/spl/examples/ini_groups.php +++ b/ext/spl/examples/ini_groups.php @@ -11,7 +11,7 @@ * Show all groups in the ini file specified by \. * The regular expression \ is used to filter the result. * - * Note: configure with --enable-dba + * Note: configure with --enable-dba */ if ($argc < 2) { diff --git a/ext/spl/examples/phar_from_dir.php b/ext/spl/examples/phar_from_dir.php index 2ee15ca1e6dbc..d75788e840ddc 100755 --- a/ext/spl/examples/phar_from_dir.php +++ b/ext/spl/examples/phar_from_dir.php @@ -9,7 +9,7 @@ * * Usage: php phar_create_from_dir.php \ \ [\] * - * Create phar archive \ using entries from \ that + * Create phar archive \ using entries from \ that * optionally match \. */ diff --git a/ext/standard/html_tables/html_table_gen.php b/ext/standard/html_tables/html_table_gen.php index 23853b5750b94..530f93c1846c9 100644 --- a/ext/standard/html_tables/html_table_gen.php +++ b/ext/standard/html_tables/html_table_gen.php @@ -190,10 +190,10 @@ enum entity_charset charset; if (preg_match("/^0x([0-9A-Z]{2})\t0x([0-9A-Z]{2,})/i", $l, $matches)) $map[] = array($matches[1], $matches[2]); } - + $mappy = array(); foreach ($map as $v) { $mappy[hexdec($v[0])] = hexdec($v[1]); } - + $mstable = array("ident" => $e['ident']); /* calculate two-stage tables */ for ($i = 0; $i < 4; $i++) { @@ -202,7 +202,7 @@ enum entity_charset charset; $mstable[$i][$j] = isset($mappy[$cp]) ? $mappy[$cp] : NULL; } } - + echo "/* {{{ Stage 2 tables for {$e['name']} */\n\n"; @@ -212,9 +212,9 @@ enum entity_charset charset; $s2tables_idents[$i] = $encodings[$t[0]/5]["ident"]; continue; } - + $s2tables_idents[$i] = $e["ident"]; - + echo "static const enc_to_uni_stage2 enc_to_uni_s2_{$e['ident']}_". sprintf("%02X", $i << 6)." = { {\n"; for ($j = 0; $j < 64; $j++) { @@ -227,10 +227,10 @@ enum entity_charset charset; echo "0xFFFF,"; /* special value; indicates no mapping */ } echo "\n} };\n\n"; - + $prevStage2[] = $mstable[$i]; } - + echo "/* end of stage 2 tables for {$e['name']} }}} */\n\n"; @@ -333,23 +333,23 @@ enum entity_charset charset; if (preg_match("/^0x([0-9A-Z]{2})\t0x([0-9A-Z]{2,})\s+#\s*(.*)$/i", $l, $matches)) $map[] = array($matches[1], $matches[2], rtrim($matches[3])); } - + $mappy = array(); foreach ($map as $v) { if (hexdec($v[0]) >= $e['range'][0] && hexdec($v[0]) <= $e['range'][1]) $mappy[hexdec($v[1])] = array(hexdec($v[0]), strtolower($v[2])); } ksort($mappy); - + echo "static const uni_to_enc unimap_{$e['ident']}[] = {\n"; - + foreach ($mappy as $k => $v) { echo "\t{ ", sprintf("0x%04X", $k), ", ", sprintf("0x%02X", $v[0]), " },\t/* ", $v[1], " */\n"; } echo "};\n"; - + echo "/* {{{ end of mappings *from* Unicode for {$e['name']} */\n\n"; } @@ -476,7 +476,7 @@ enum entity_charset charset; $v['default'] = "gt"; echo "\t{ {", sprintf("\"%-21s", $v["default"].'",'), "\t", sprintf("%02d", (count($v) - 1)), ",\t\t", - sprintf("% 2d", strlen($v["default"])), '} },', "\n"; + sprintf("% 2d", strlen($v["default"])), '} },', "\n"; } else { echo "\t{ {", sprintf("%-22s", 'NULL,'), "\t", sprintf("%02d", count($v)), ",\t\t0} },\n"; @@ -484,7 +484,7 @@ enum entity_charset charset; unset($v["default"]); foreach ($v as $l => $w) { echo "\t{ {", sprintf("\"%-21s", $w.'",'), "\t", sprintf("0x%05s", $l), ",\t", - sprintf("% 2d", strlen($w)), '} },', "\n"; + sprintf("% 2d", strlen($w)), '} },', "\n"; } echo "};\n"; } @@ -561,7 +561,7 @@ enum entity_charset charset; else echo "{1, { {(void *)", sprintf("multi_cp_{$ident}_%05X", ($i << 12) | ($k << 6) | $y ), ", 0} } },"; - + } echo "\n};\n\n"; } @@ -685,7 +685,7 @@ enum entity_charset charset; // die("violated assumption for traverse_for_entities"); // } // } -// +// // $k++; //} //echo "\n};\n\n"; diff --git a/ext/zip/examples/oldapi.php b/ext/zip/examples/oldapi.php index 2f17f43ebd0f4..82a6277f3a8d9 100644 --- a/ext/zip/examples/oldapi.php +++ b/ext/zip/examples/oldapi.php @@ -8,8 +8,8 @@ while ($zip_entry = zip_read($zip)) { var_dump($zip_entry); $txt = zip_entry_read($zip_entry, 10); - echo $i . ": " . $txt . "size: " . zip_entry_filesize($zip_entry) . - "comp_method: " . zip_entry_compressionmethod($zip_entry) . + echo $i . ": " . $txt . "size: " . zip_entry_filesize($zip_entry) . + "comp_method: " . zip_entry_compressionmethod($zip_entry) . "\n"; $i++; } diff --git a/run-tests.php b/run-tests.php index 2bb4c95ba838a..896e9965c31ef 100755 --- a/run-tests.php +++ b/run-tests.php @@ -98,7 +98,7 @@ } if (empty($environment['TEMP'])) { $environment['TEMP'] = sys_get_temp_dir(); - + if (empty($environment['TEMP'])) { // for example, OpCache on Windows will fail in this case because child processes (for tests) will not get // a TEMP variable, so GetTempPath() will fallback to c:\windows, while GetTempPath() will return %TEMP% for parent @@ -106,7 +106,7 @@ // the OpCache because it will be using the wrong path. die("TEMP environment is NOT set"); } else if (count($environment)==1) { - // not having other environment variables, only having TEMP, is probably ok, but strange and may make a + // not having other environment variables, only having TEMP, is probably ok, but strange and may make a // difference in the test pass rate, so warn the user. echo "WARNING: Only 1 environment variable will be available to tests(TEMP environment variable)".PHP_EOL; } diff --git a/sapi/phpdbg/web-bootstrap.php b/sapi/phpdbg/web-bootstrap.php index 7b8c5d30de8dc..046062997ee69 100644 --- a/sapi/phpdbg/web-bootstrap.php +++ b/sapi/phpdbg/web-bootstrap.php @@ -1,26 +1,26 @@ 'localhost', 'HTTP_CONNECTION' => 'keep-alive', diff --git a/scripts/dev/find_tested.php b/scripts/dev/find_tested.php index 0881e9ea47183..18521638d3d1c 100644 --- a/scripts/dev/find_tested.php +++ b/scripts/dev/find_tested.php @@ -71,7 +71,7 @@ /** * The loop to ouput the test coverage info * Should output: Extension, Class Name, Method/Function Name, Test Status, Test Files - */ + */ foreach($extension_method_info as $record) { echo $record[EXTENSION_NAME] . ","; echo $record[CLASS_NAME] . ","; @@ -84,7 +84,7 @@ * Marks the "tested" status of methods in $method_info according * to whether they are tested in $phpt_files */ -function mark_methods_as_tested($method_info, $phpt_files) { +function mark_methods_as_tested($method_info, $phpt_files) { foreach($phpt_files as $phpt_file) { $tested_functions = extract_tests($phpt_file); @@ -97,7 +97,7 @@ function mark_methods_as_tested($method_info, $phpt_files) { // matched the method name if ($current_method_record[IS_DUPLICATE] == true) { // we cannot be sure which class this method corresponds to, - // so mark method as needing to be verified + // so mark method as needing to be verified $current_method_record[IS_TESTED] = "verify"; } else { $current_method_record[IS_TESTED] = "yes"; @@ -114,7 +114,7 @@ function mark_methods_as_tested($method_info, $phpt_files) { * returns an array containing a record for each defined method. */ function populate_method_info() { - + $method_info = array(); // get functions @@ -197,21 +197,21 @@ function get_phpt_files($dir, &$phpt_file_count, &$all_phpt) } /** - * Extract tests from a specified file, returns an array of tested function tokens - */ + * Extract tests from a specified file, returns an array of tested function tokens + */ function extract_tests($file) { $code = file_get_contents($file); - + if (!preg_match('/--FILE--\s*(.*)\s*--(EXPECTF|EXPECTREGEX|EXPECT)?--/is', $code, $r)) { //print "Unable to get code in ".$file."\n"; return array(); } - + $tokens = token_get_all($r[1]); $functions = array_filter($tokens, 'filter_functions'); $functions = array_map( 'map_token_value',$functions); $functions = array_unique($functions); - + return $functions; } diff --git a/scripts/dev/generate-phpt/src/generate-phpt.php b/scripts/dev/generate-phpt/src/generate-phpt.php index 4f57a70b54a9d..73071e284600e 100644 --- a/scripts/dev/generate-phpt/src/generate-phpt.php +++ b/scripts/dev/generate-phpt/src/generate-phpt.php @@ -39,17 +39,17 @@ if($options->hasOption('s')) { $optionalSections->setOptions($options); } - + if($options->hasOption('c')) { $name = $options->getOption('c')."_".$options->getOption('m'); $method = new gtMethod($options->getOption('c'), $options->getOption('m')); - + $method->setArgumentNames(); $method->setArgumentLists(); $method->setInitialisationStatements(); - + $method->setConstructorArgumentNames(); $method->setConstructorInitStatements(); $method->setConstructorArgumentList(); diff --git a/scripts/dev/generate-phpt/src/gtClassMap.php b/scripts/dev/generate-phpt/src/gtClassMap.php index 3e45b4764de26..1c346b83ce3ad 100644 --- a/scripts/dev/generate-phpt/src/gtClassMap.php +++ b/scripts/dev/generate-phpt/src/gtClassMap.php @@ -1,23 +1,23 @@ 'gtCodeSnippet.php', 'gtTestSubject' => 'gtTestSubject.php', 'gtFunction' => 'gtFunction.php', 'gtMethod' => 'gtMethod.php', 'gtTestCaseWriter' => 'gtTestCaseWriter.php', 'gtText' => 'gtText.php', - - - + + + 'gtCommandLineOptions' => 'setup/gtCommandLineOptions.php', 'gtOptionalSections' => 'setup/gtOptionalSections.php', 'gtMissingArgumentException' => 'setup/exceptions/gtMissingArgumentException.php', 'gtUnknownOptionException' => 'setup/exceptions/gtUnknownOptionException.php', 'gtUnknownSectionException' => 'setup/exceptions/gtUnknownSectionException.php', 'gtMissingOptionsException' => 'setup/exceptions/gtMissingOptionsException.php', - + 'gtPreCondition' => 'setup/gtPreCondition.php', 'gtPreConditionList' => 'setup/gtPreConditionList.php', 'gtIsSpecifiedTestType' => 'setup/preconditions/gtIsSpecifiedTestType.php', @@ -26,21 +26,21 @@ 'gtIsValidClass' => 'setup/preconditions/gtIsValidClass.php', 'gtIsValidMethod' => 'setup/preconditions/gtIsValidMethod.php', 'gtIsValidFunction' => 'setup/preconditions/gtIsValidFunction.php', - - + + 'gtTestCase' => 'testcase/gtTestCase.php', 'gtVariationTestCase' => 'testcase/gtVariationTestCase.php', 'gtVariationTestCaseFunction' => 'testcase/gtVariationTestCaseFunction.php', 'gtVariationTestCaseMethod' => 'testcase/gtVariationTestCaseMethod.php', - + 'gtBasicTestCase' => 'testcase/gtBasicTestCase.php', 'gtBasicTestCaseFunction' => 'testcase/gtBasicTestCaseFunction.php', 'gtBasicTestCaseMethod' => 'testcase/gtBasicTestCaseMethod.php', - + 'gtErrorTestCase' => 'testcase/gtErrorTestCase.php', 'gtErrorTestCaseFunction' => 'testcase/gtErrorTestCaseFunction.php', 'gtErrorTestCaseMethod' => 'testcase/gtErrorTestCaseMethod.php', - + 'gtVariationContainer' => 'testcase/gtVariationContainer.php', 'gtVariationContainerMethod' => 'testcase/gtVariationContainerMethod.php', 'gtVariationContainerFunction' => 'testcase/gtVariationContainerFunction.php', diff --git a/scripts/dev/generate-phpt/src/gtCodeSnippet.php b/scripts/dev/generate-phpt/src/gtCodeSnippet.php index 220fbdf6997c8..dc6543201a7ae 100644 --- a/scripts/dev/generate-phpt/src/gtCodeSnippet.php +++ b/scripts/dev/generate-phpt/src/gtCodeSnippet.php @@ -2,7 +2,7 @@ /** * Retrieves code snippets for adding to test cases - * + * */ class gtCodeSnippet { @@ -14,21 +14,21 @@ class gtCodeSnippet * @return array */ public static function get($name) { - + $filename = dirname(__FILE__) . '/codeSnippets/' . $name . '.txt'; if (!file_exists($filename)) { throw new LogicException('The code snippet ' . $name . ' does not exist'); } - + $lines = file($filename); foreach($lines as $l) { $array[] = rtrim($l); } return $array; } - - + + /** * Append the code snippet on to an existing array * @@ -47,11 +47,11 @@ public static function append($name, $array) { foreach ($text as $t) { $array[] = rtrim($t); } - + return $array; } - - + + /** * Appends blank entries on to an array * @@ -64,9 +64,9 @@ public static function appendBlankLines($numberOfLines, $array) { for ($i=0; $i< $numberOfLines; $i++) { $array[] = ""; } - + return $array; } - + } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/gtFunction.php b/scripts/dev/generate-phpt/src/gtFunction.php index 47f4bafcb34b1..b2752ad637bdb 100644 --- a/scripts/dev/generate-phpt/src/gtFunction.php +++ b/scripts/dev/generate-phpt/src/gtFunction.php @@ -7,7 +7,7 @@ class gtFunction extends gtTestSubject { private $functionName; - + /** * Set the name of the name of the function * diff --git a/scripts/dev/generate-phpt/src/gtMethod.php b/scripts/dev/generate-phpt/src/gtMethod.php index 820d7e0a7602d..dc8438c3b5f63 100644 --- a/scripts/dev/generate-phpt/src/gtMethod.php +++ b/scripts/dev/generate-phpt/src/gtMethod.php @@ -39,7 +39,7 @@ public function setConstructorArgumentNames() { } } - + /** * Set the names of the mandatory and optional arguments to the method * @@ -87,14 +87,14 @@ public function getName() { public function getClassName() { return $this->className; } - + /** * Set the list of arguments to be passed to the constructor * */ public function setConstructorArgumentList() { if(count ($this->constructorArgumentNames) > 0) { - + for( $i = 0; $i < count( $this->constructorArgumentNames ); $i++) { $this->constructorArgumentList .= "\$".$this->constructorArgumentNames[$i].", "; } @@ -112,7 +112,7 @@ public function getConstructorArgumentList() { return $this->constructorArgumentList; } - + /** * Set up the source statements that initialise constructor arguments; * @@ -126,7 +126,7 @@ public function setConstructorInitStatements() { } - + /** * Return the constructor initialisation statements * diff --git a/scripts/dev/generate-phpt/src/gtTestCaseWriter.php b/scripts/dev/generate-phpt/src/gtTestCaseWriter.php index cc57863d9bd8f..9438e0f2ea1e5 100644 --- a/scripts/dev/generate-phpt/src/gtTestCaseWriter.php +++ b/scripts/dev/generate-phpt/src/gtTestCaseWriter.php @@ -5,20 +5,20 @@ * */ class gtTestCaseWriter { - + public static function write($name, $string, $type, $count = 0) { if ($type == 'b') { $fileName = $name."_basic.phpt"; } - + if ($type == 'e') { $fileName = $name."_error.phpt"; } - + if ($type == 'v') { $fileName = $name."_variation".$count.".phpt"; } - + $fh = fopen($fileName, 'w'); fwrite ($fh, $string); fclose($fh); diff --git a/scripts/dev/generate-phpt/src/gtTestSubject.php b/scripts/dev/generate-phpt/src/gtTestSubject.php index 76454dc7b85bb..782c99d6c72ce 100644 --- a/scripts/dev/generate-phpt/src/gtTestSubject.php +++ b/scripts/dev/generate-phpt/src/gtTestSubject.php @@ -10,7 +10,7 @@ abstract class gtTestSubject { protected $allowedArgumentLists; protected $maximumArgumentList; - + protected $initialisationStatements; @@ -31,7 +31,7 @@ public function getMandatoryArgumentNames() { public function getOptionalArgumentNames() { return $this->optionalArgumentNames; } - + public function setArgumentLists() { $this->setValidArgumentLists(); $this->setExtraArgumentList(); @@ -48,7 +48,7 @@ public function setExtraArgumentList() { $this->extraArgumentList .= "\$".$this->mandatoryArgumentNames[$i].", "; } } - + if(count ($this->optionalArgumentNames) > 0) { for( $i = 0; $i < count( $this->optionalArgumentNames ); $i++) { $this->extraArgumentList .= "\$".$this->optionalArgumentNames[$i].", "; @@ -57,7 +57,7 @@ public function setExtraArgumentList() { $this->extraArgumentList= $this->extraArgumentList. "\$extra_arg"; } - + /** * Return the list of arguments as it appears in the function call @@ -105,7 +105,7 @@ public function setValidArgumentLists() { $this->allowedArgumentLists[0] .= "\$".$this->mandatoryArgumentNames[$i].", "; } } - + if(count ($this->optionalArgumentNames) > 0) { for( $i = 0; $i < count( $this->optionalArgumentNames ); $i++) { $this->allowedArgumentLists[] = $this->allowedArgumentLists[$i]."\$".$this->optionalArgumentNames[$i].", "; @@ -153,7 +153,7 @@ public function setInitialisationStatements() { } } } - + /** * Return the initialisation statements * diff --git a/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php b/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php index 0e4d878bab493..b1068e46004cb 100644 --- a/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php +++ b/scripts/dev/generate-phpt/src/setup/gtCommandLineOptions.php @@ -22,7 +22,7 @@ class gtCommandLineOptions { 'x', 'k', ); - + protected $options; protected function isShortOption($arg) @@ -44,7 +44,7 @@ public function parse($argv) if(count($argv) < 2) { throw new gtMissingOptionsException('Command line options are required'); } - + for ($i=1; $iisShortOption($argv[$i])) { @@ -72,7 +72,7 @@ public function parse($argv) $this->options[$option] = $argv[$i]; } } - + /** * */ diff --git a/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php b/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php index 1d2a163175bd2..6c6de18345602 100644 --- a/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php +++ b/scripts/dev/generate-phpt/src/setup/gtOptionalSections.php @@ -28,11 +28,11 @@ public function setOptions($commandLineOptions) { if($commandLineOptions->hasOption('k')) { $this->skipifKey = $commandLineOptions->getOption('k'); } - + if($commandLineOptions->hasOption('x')) { $this->skipifExt = $commandLineOptions->getOption('x'); } - + } } @@ -46,7 +46,7 @@ public function getOptions() { public function getSkipifKey() { return $this->skipifKey; } - + public function getSkipifExt() { return $this->skipifExt; } @@ -61,7 +61,7 @@ public function hasSkipifKey() { } return false; } - + public function hasSkipifExt() { if($this->skipifExt != '') { return true; @@ -75,7 +75,7 @@ public function hasIni() { public function hasClean() { return $this->optSections['clean']; } - + public function hasDone() { return $this->optSections['done']; } diff --git a/scripts/dev/generate-phpt/src/setup/gtPreCondition.php b/scripts/dev/generate-phpt/src/setup/gtPreCondition.php index 858395bc9dc0f..294b41e9f2c17 100644 --- a/scripts/dev/generate-phpt/src/setup/gtPreCondition.php +++ b/scripts/dev/generate-phpt/src/setup/gtPreCondition.php @@ -5,10 +5,10 @@ * */ abstract class gtPreCondition { - - abstract public function check($clo); - - abstract public function getMessage(); - + + abstract public function check($clo); + + abstract public function getMessage(); + } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php b/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php index 06c17521f2ffe..88f9b36205c9a 100644 --- a/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php +++ b/scripts/dev/generate-phpt/src/setup/gtPreConditionList.php @@ -5,10 +5,10 @@ * */ class gtPreConditionList { - + private $preConditions = array( 'gtIsSpecifiedTestType', - 'gtIsSpecifiedFunctionOrMethod', + 'gtIsSpecifiedFunctionOrMethod', 'gtIfClassHasMethod', 'gtIsValidClass', 'gtIsValidFunction', diff --git a/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php b/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php index c91b210714c95..edd7a1cbae61b 100644 --- a/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php +++ b/scripts/dev/generate-phpt/src/setup/preconditions/gtIfClassHasMethod.php @@ -5,7 +5,7 @@ * */ class gtIfClassHasMethod extends gtPreCondition { - + public function check( $clo) { if($clo->hasOption('c')) { if(!$clo->hasOption('m')) { @@ -15,7 +15,7 @@ public function check( $clo) { } return true; } - + public function getMessage() { return gtText::get('methodNotSpecified'); } diff --git a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php index 7495c73ecaabe..f70af881ec01b 100644 --- a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php +++ b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedFunctionOrMethod.php @@ -5,15 +5,15 @@ * */ class gtIsSpecifiedFunctionOrMethod extends gtPreCondition { - + public function check( $clo) { if($clo->hasOption('f') || $clo->hasOption('m')) { - + return true; } return false; } - + public function getMessage() { return gtText::get('functionOrMethodNotSpecified'); } diff --git a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php index 40530f3aca84b..ebc0a68f57680 100644 --- a/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php +++ b/scripts/dev/generate-phpt/src/setup/preconditions/gtIsSpecifiedTestType.php @@ -5,15 +5,15 @@ * */ class gtIsSpecifiedTestType extends gtPreCondition { - + public function check( $clo) { if($clo->hasOption('b') || $clo->hasOption('e') || $clo->hasOption('v') ) { - + return true; } return false; } - + public function getMessage() { return gtText::get('testTypeNotSpecified'); } diff --git a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php index 684c24dd7eaf1..92560c8631143 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php +++ b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCase.php @@ -23,12 +23,12 @@ public static function getInstance($optionalSections, $type = 'function') { return new gtBasicTestCaseMethod($optionalSections); } } - + public function constructSubjectCalls() { $this->argInit(); $this->subjectCalls(); } - + public function addBasicEcho() { $this->testCase[] = "echo \"*** Test by calling method or function with its expected arguments ***\\n\";"; $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase ); diff --git a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php index f64c6daf329b8..c0fc9eb61f59a 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php +++ b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseFunction.php @@ -22,13 +22,13 @@ public function setFunction($function) { public function constructTestCase() { $this->constructCommonHeaders(); - + $this->addBasicEcho(); - + $this->constructSubjectCalls(); - + $this->constructCommonClosing(); - + } diff --git a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php index 3d3896e233b3e..d009d5038ae3b 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php +++ b/scripts/dev/generate-phpt/src/testcase/gtBasicTestCaseMethod.php @@ -10,34 +10,34 @@ public function __construct($opt) { } /** - * Set the method + * Set the method * * @param gtMethod $method */ public function setMethod($method) { $this->subject = $method; } - + public function constructTestCase() { $this->constructCommonHeaders(); $this->addBasicEcho(); - + $this->constructorArgInit(); $this->constructorCreateInstance(); - + $this->constructSubjectCalls(); - + $this->constructCommonClosing(); - + } public function testHeader() { $this->testCase[] = "--TEST--"; $this->testCase[] = "Test class ".$this->subject->getClassName()." method ".$this->subject->getName()."() by calling it with its expected arguments"; - + } - + public function subjectCalls() { $lists = $this->subject->getValidArgumentLists(); @@ -45,7 +45,7 @@ public function subjectCalls() { $this->testCase[] = "var_dump( \$class->".$this->subject->getName()."( ".$list." ) );"; $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase ); } - $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase ); + $this->testCase = gtCodeSnippet::appendBlankLines(2, $this->testCase ); } } diff --git a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php index 214e3d28ba126..82f955cf46783 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php +++ b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCase.php @@ -17,7 +17,7 @@ abstract class gtErrorTestCase extends gtTestCase { * @return test case object */ public static function getInstance($optionalSections, $type = 'function') { - + if($type == 'function') { return new gtErrorTestCaseFunction($optionalSections); } @@ -34,16 +34,16 @@ public function getShortArgumentList() { public function getLongArgumentList() { return $this->longArgumentList; } - + public function constructSubjectCalls() { $this->argInit(); - + //Initialise the additional argument $this->testCase[] = "\$extra_arg = "; - + $this->subjectCalls(); } - + public function addErrorEcho() { $this->testCase[] = "echo \"*** Test by calling method or function with incorrect numbers of arguments ***\\n\";"; $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase ); diff --git a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php index 2453acf6fde56..fcba6d798c4e8 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php +++ b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseFunction.php @@ -26,13 +26,13 @@ public function setFunction($function) { */ public function constructTestCase() { $this->constructCommonHeaders(); - + $this->addErrorEcho(); - + $this->constructSubjectCalls(); - + $this->constructCommonClosing(); - + } diff --git a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php index 647e52f93e675..fa1c8ca3f19f7 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php +++ b/scripts/dev/generate-phpt/src/testcase/gtErrorTestCaseMethod.php @@ -27,33 +27,33 @@ public function setMethod($method) { */ public function constructTestCase() { $this->constructCommonHeaders(); - + $this->addErrorEcho(); - + $this->constructorArgInit(); $this->constructorCreateInstance(); - + $this->constructSubjectCalls(); - + $this->constructCommonClosing(); } - + public function testHeader() { $this->testCase[] = "--TEST--"; $this->testCase[] = "Test class ".$this->subject->getClassName()." method ".$this->subject->getName()."() by calling it more than or less than its expected arguments"; } - + public function subjectCalls() { // Construct the argument list to pass to the method being tested $list = $this->subject->getExtraArgumentList(); $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase ); $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );"; - + $list = $this->subject->getShortArgumentList(); $this->testCase = gtCodeSnippet::appendBlankLines(1, $this->testCase ); $this->testCase[] = "var_dump(".$this->subject->getName()."( ".$list." ) );"; - + } } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/testcase/gtTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtTestCase.php index 60c115a9c1afb..e6fa7affcf2c1 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtTestCase.php +++ b/scripts/dev/generate-phpt/src/testcase/gtTestCase.php @@ -80,11 +80,11 @@ public function ConstructCommonHeaders() { */ public function ConstructCommonClosing() { $this->fileClosing(); - + if ($this->optionalSections->hasDone()) { $this->addDone(); } - + if ($this->optionalSections->hasClean()) { $this->addClean(); } diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php b/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php index 59951707ce108..f445d9e7f4d3d 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php +++ b/scripts/dev/generate-phpt/src/testcase/gtVariationContainer.php @@ -4,9 +4,9 @@ * Container for all possible variation test cases */ abstract class gtVariationContainer { - + protected $variationTests; - + protected $dataTypes = array ( 'array', 'boolean', @@ -16,9 +16,9 @@ abstract class gtVariationContainer { 'object', 'string', ); - - - + + + /** * Return an instance of a containers for either function or method tests * @@ -26,21 +26,21 @@ abstract class gtVariationContainer { * @return variation test container */ public static function getInstance ($optionalSections, $type = 'function') { - + if($type == 'function') { return new gtVariationContainerFunction($optionalSections); } if($type =='method') { return new gtVariationContainerMethod($optionalSections); } - + } - - + + public function constructAll() { } - - + + /** * Returns all varaition tests as an array of arrays * @@ -49,6 +49,6 @@ public function constructAll() { public function getVariationTests() { return $this->variationTests; } - + } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php index a62882a81a047..b6a3aa473cd62 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php +++ b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerFunction.php @@ -4,14 +4,14 @@ * Container for all possible variation test cases of functions */ class gtVariationContainerFunction extends gtVariationContainer { - + protected $function; protected $optionalSections; - + public function __construct($osl) { $this->optionalSections = $osl; } - + /** * Sets function being tested * @@ -20,15 +20,15 @@ public function __construct($osl) { public function setFunction(gtFunction $function) { $this->function = $function; } - - + + /** * constructs all possible variation testcases in array $this->variationTests * */ public function constructAll() { - - + + $numberOfArguments = count($this->function->getMandatoryArgumentNames()) + count($this->function->getOptionalArgumentNames()); for($i = 1; $i <= $numberOfArguments; $i++) { foreach ($this->dataTypes as $d) { @@ -38,6 +38,6 @@ public function constructAll() { $this->variationTests[] = $testCase->toString(); } } - } + } } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php index bee26b08aa2b4..0d24337b3b0f7 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php +++ b/scripts/dev/generate-phpt/src/testcase/gtVariationContainerMethod.php @@ -3,15 +3,15 @@ * Container for all possible variation test cases for a method */ class gtVariationContainerMethod extends gtVariationContainer { - + protected $method; protected $optionalSections; - + public function __construct($osl) { $this->optionalSections = $osl; } - - + + /** * Sets the method to be tested * @@ -20,27 +20,27 @@ public function __construct($osl) { public function setMethod(gtMethod $method) { $this->method = $method; } - - + + /** * Constructs all variation tests in $this_variationTests * */ public function constructAll() { - + $numberOfArguments = count($this->method->getMandatoryArgumentNames()) + count($this->method->getOptionalArgumentNames()); - + for($i = 1; $i <= $numberOfArguments; $i++) { - + foreach ($this->dataTypes as $d) { - + $testCase = gtVariationTestCase::getInstance($this->optionalSections, 'method'); $testCase->setUp($this->method, $i, $d); $testCase->constructTestCase(); $this->variationTests[] = $testCase->toString(); - + } } - } + } } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php index 039367d5b3d0a..e868b80795eda 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php +++ b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCase.php @@ -15,7 +15,7 @@ abstract class gtVariationTestCase extends gtTestCase { * @return test case object */ public static function getInstance($optionalSections, $type = 'function') { - + if($type == 'function') { return new gtVariationTestCaseFunction($optionalSections); } diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php index 7bf1c8b778d1d..45cbe2046cc86 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php +++ b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseFunction.php @@ -32,22 +32,22 @@ public function setUp(gtfunction $function, $argumentNumber, $variationData) { * */ public function constructTestCase() { - $this->constructCommonHeaders(); - + $this->constructCommonHeaders(); + $this->addVariationEcho(); - + $this->constructSubjectCalls(); - + $this->constructCommonClosing(); - + } public function testHeader() { $this->testCase[] = "--TEST--"; $this->testCase[] = "Test function ".$this->subject->getName()."() by substituting argument ".$this->argumentNumber." with ".$this->variationData." values."; } - - public function subjectCalls() { + + public function subjectCalls() { $this->testCase = gtCodeSnippet::append('loopStart', $this->testCase); // Construct the argument list to pass to the function being tested @@ -59,6 +59,6 @@ public function subjectCalls() { $this->testCase[] = " var_dump(".$this->subject->getName()."( ".$list." ) );"; $this->testCase = gtCodeSnippet::append('loopClose', $this->testCase); } - + } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php index a9c921f9db550..db923f078ac42 100644 --- a/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php +++ b/scripts/dev/generate-phpt/src/testcase/gtVariationTestCaseMethod.php @@ -34,15 +34,15 @@ public function setUp(gtMethod $method, $argumentNumber, $variationData) { */ public function constructTestCase() { $this->constructCommonHeaders(); - + $this->addVariationEcho(); - + $this->constructorArgInit(); $this->constructorCreateInstance(); - + $this->constructSubjectcalls(); $this->constructCommonClosing(); - + } public function testHeader() { diff --git a/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php b/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php index dbba0d6470e79..fa80c0766daa8 100644 --- a/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php +++ b/scripts/dev/generate-phpt/tests/gtBasicTestCaseFunctionTest.php @@ -6,13 +6,13 @@ class gtBasicTestCaseFunctionTest extends PHPUnit_Framework_TestCase { public function testTestCase() { - + $f = new gtFunction('cos'); $f->setArgumentNames(); $f->setArgumentLists(); $f->setInitialisationStatements(); $optSect = new gtOptionalSections(); - + $btc = gtBasicTestCase::getInstance($optSect); $btc->setFunction($f); $btc->constructTestCase(); diff --git a/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php b/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php index 81307f139cae3..18768b629434a 100644 --- a/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php +++ b/scripts/dev/generate-phpt/tests/gtBasicTestCaseMethodTest.php @@ -6,7 +6,7 @@ class gtBasicTestCaseMethodTest extends PHPUnit_Framework_TestCase { public function testTestCase() { - + $f = new gtMethod('DOMDocument','createAttribute'); $f->setArgumentNames(); $f->setArgumentLists(); @@ -18,11 +18,11 @@ public function testTestCase() { $btc = gtBasicTestCaseMethod::getInstance($optSect, 'method'); $btc->setMethod($f); $btc->constructTestCase(); - + $fs = $btc->toString(); $this->assertTrue(is_string($fs)); - + } } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php b/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php index bc0c48a5a1c06..6d4d5861c3163 100644 --- a/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php +++ b/scripts/dev/generate-phpt/tests/gtCodeSnippetTest.php @@ -5,7 +5,7 @@ class gtCodeSnippetTest extends PHPUnit_Framework_TestCase { - + public function testAppend() { $array = array('something', 'nothing'); $array = gtCodeSnippet::append('loopClose', $array); diff --git a/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php b/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php index 2fd6818a4507a..1bf32b460869b 100644 --- a/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php +++ b/scripts/dev/generate-phpt/tests/gtCommandLineOptionsTest.php @@ -5,7 +5,7 @@ class gtCommandLineOptionsTest extends PHPUnit_Framework_TestCase { - + /** * @expectedException RuntimeException */ @@ -26,7 +26,7 @@ public function testShortOptionArgument() { $this->assertTrue($clo->hasOption('f')); $this->assertEquals('some-function', $clo->getOption('f')); } - + /** * @expectedException RuntimeException */ @@ -34,7 +34,7 @@ public function testInvalidOption() { $clo = new gtCommandLineOptions(); $clo->parse(array('generate-phpt.php', '-z')); } - + /** * @expectedException RuntimeException */ diff --git a/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php b/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php index 5b72fcc9f5b18..c6399168be3b8 100644 --- a/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php +++ b/scripts/dev/generate-phpt/tests/gtErrorTestCaseFunctionTest.php @@ -6,23 +6,23 @@ class gtErrorTestCaseFunctionTest extends PHPUnit_Framework_TestCase { public function testTestCase() { - + $f = new gtFunction('cos'); $f->setArgumentNames(); $f->setArgumentLists(); $f->setInitialisationStatements(); - + $optSect = new gtOptionalSections(); - + $btc = gtErrorTestCase::getInstance($optSect); $btc->setFunction($f); $btc->constructTestCase(); - - + + $fs = $btc->toString(); $this->assertTrue(is_string($fs)); - + } - + } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php b/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php index 7077881296fe3..894a551597194 100644 --- a/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php +++ b/scripts/dev/generate-phpt/tests/gtErrorTestCaseMethodTest.php @@ -6,7 +6,7 @@ class gtErrorTestCaseMethodTest extends PHPUnit_Framework_TestCase { public function testTestCase() { - + $f = new gtMethod('DOMDocument', 'createAttribute'); $f->setArgumentNames(); $f->setArgumentLists(); @@ -15,14 +15,14 @@ public function testTestCase() { $f->setConstructorArgumentNames(); $f->setConstructorInitStatements(); - + $optSect = new gtOptionalSections(); - + $btc = gtErrorTestCase::getInstance($optSect,'method'); $btc->setMethod($f); $btc->constructTestCase(); - - + + $fs = $btc->toString(); $this->assertTrue(is_string($fs)); } diff --git a/scripts/dev/generate-phpt/tests/gtFunctionTest.php b/scripts/dev/generate-phpt/tests/gtFunctionTest.php index 0aa7eac1199ff..5afcd950d46fb 100644 --- a/scripts/dev/generate-phpt/tests/gtFunctionTest.php +++ b/scripts/dev/generate-phpt/tests/gtFunctionTest.php @@ -43,25 +43,25 @@ public function testShortArguments() { $this->assertEquals('$ver1', $f->getShortArgumentList()); } - + public function testAllArgumentList() { $f = new gtFunction('version_compare'); $f->setArgumentNames(); $f->setValidArgumentLists(); $a = $f->getValidArgumentLists(); - + $this->assertEquals('$ver1, $ver2', $a[0]); $this->assertEquals('$ver1, $ver2, $oper', $a[1]); } - + public function testInitialisation() { $f = new gtFunction('version_compare'); $f->setArgumentNames(); $f->setInitialisationStatements(); $a = $f->getInitialisationStatements(); - + $this->assertEquals('$ver1 = ', $a[0]); $this->assertEquals('$ver2 = ', $a[1]); $this->assertEquals('$oper = ', $a[2]); diff --git a/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php b/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php index 064edf3b65525..a60f77ef37730 100644 --- a/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php +++ b/scripts/dev/generate-phpt/tests/gtIsSpecifiedFunctionOrMethodTest.php @@ -20,16 +20,16 @@ public function testValid2() { $ch = new gtIsSpecifiedFunctionOrMethod(); $this->assertTrue($ch->check($clo)); } - + public function testNotValid() { $clo = new gtCommandLineOptions(); $clo->parse(array('generate-phpt.php', '-b')); $ch = new gtIsSpecifiedFunctionOrMethod(); $this->assertFalse($ch->check($clo)); - + } - + public function testMessage() { $clo = new gtCommandLineOptions(); diff --git a/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php b/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php index c8b0a4e36a92f..bc7cf9412d7cf 100644 --- a/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php +++ b/scripts/dev/generate-phpt/tests/gtIsSpecifiedTestTypeTest.php @@ -20,7 +20,7 @@ public function testNotValid() { $ch = new gtIsSpecifiedTestType(); $this->assertFalse($ch->check($clo)); } - + public function testMessage() { $clo = new gtCommandLineOptions(); diff --git a/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php b/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php index 51ca87879d67c..507ca232db595 100644 --- a/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php +++ b/scripts/dev/generate-phpt/tests/gtIsValidClassTest.php @@ -20,7 +20,7 @@ public function testNotValid() { $ch = new gtIsValidClass(); $this->assertFalse($ch->check($clo)); } - + public function testNotGiven() { $clo = new gtCommandLineOptions(); @@ -28,7 +28,7 @@ public function testNotGiven() { $ch = new gtIsValidClass(); $this->assertTrue($ch->check($clo)); } - + public function testMessage() { $clo = new gtCommandLineOptions(); diff --git a/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php b/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php index d4700b9d66521..07a7038dccd53 100644 --- a/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php +++ b/scripts/dev/generate-phpt/tests/gtIsValidFunctionTest.php @@ -20,7 +20,7 @@ public function testNotValid() { $ch = new gtIsValidFunction(); $this->assertFalse($ch->check($clo)); } - + public function testNotSupplied() { $clo = new gtCommandLineOptions(); @@ -28,7 +28,7 @@ public function testNotSupplied() { $ch = new gtIsValidFunction(); $this->assertTrue($ch->check($clo)); } - + public function testMessage() { $clo = new gtCommandLineOptions(); diff --git a/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php b/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php index fe069977eff75..0f1b349f4d5c7 100644 --- a/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php +++ b/scripts/dev/generate-phpt/tests/gtIsValidMethodTest.php @@ -20,7 +20,7 @@ public function testNotValid() { $ch = new gtIsValidMethod(); $this->assertFalse($ch->check($clo)); } - + public function testNotGiven() { $clo = new gtCommandLineOptions(); @@ -28,7 +28,7 @@ public function testNotGiven() { $ch = new gtIsValidMethod(); $this->assertTrue($ch->check($clo)); } - + public function testMessage() { $clo = new gtCommandLineOptions(); diff --git a/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php b/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php index dbf2994567628..541dbdf2ddbf5 100644 --- a/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php +++ b/scripts/dev/generate-phpt/tests/gtOptionalSectionsTest.php @@ -27,29 +27,29 @@ public function testException() { $opt = new gtOptionalSections(); $opt->setOptions($clo); } - + public function testSkip() { $clo = new gtCommandLineOptions(); $clo->parse(array('generate-phpt.php', '-s', 'skipif', '-x', 'standard')); $opt = new gtOptionalSections(); $opt->setOptions($clo); - + $opt = new gtOptionalSections(); $opt->setOptions($clo); - + $this->assertEquals('standard', $opt->getSkipifExt() ); } - + public function testSkipKey() { $clo = new gtCommandLineOptions(); $clo->parse(array('generate-phpt.php', '-s', 'skipif', '-k', 'win')); $opt = new gtOptionalSections(); $opt->setOptions($clo); - + $opt = new gtOptionalSections(); $opt->setOptions($clo); - + $this->assertEquals('win', $opt->getSkipifKey() ); } diff --git a/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php b/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php index df9f21c309e37..83178b21e78a9 100644 --- a/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php +++ b/scripts/dev/generate-phpt/tests/gtVariationTestCaseFunctionTest.php @@ -5,55 +5,55 @@ class gtVariationTestCaseFunctionTest extends PHPUnit_Framework_TestCase { public function testTestCase() { - + $f = new gtFunction('cos'); $f->setArgumentNames(); $f->setArgumentLists(); - + $optSect = new gtOptionalSections(); - + $vtc = gtVariationTestCase::getInstance($optSect); $vtc->setUp($f, 1, 'int'); $vtc->constructTestCase(); - + $fs = $vtc->toString(); $this->assertTrue(is_string($fs)); - + } public function testTestCase2() { - + $f = new gtFunction('date_sunrise'); $f->setArgumentNames(); $f->setArgumentLists(); $a = $f->getMandatoryArgumentNames(); - + $optSect = new gtOptionalSections(); - + $vtc = gtVariationTestCase::getInstance($optSect); $vtc->setUp($f, 6, 'int'); $vtc->constructTestCase(); - + $fs = $vtc->toString(); $this->assertTrue(is_string($fs)); - + } - + public function testTestCase3() { - + $f = new gtFunction('date_sunrise'); $f->setArgumentNames(); $f->setArgumentLists(); - + $optSect = new gtOptionalSections(); $vtc = gtVariationTestCase::getInstance($optSect); $vtc->setUp($f, 6, 'array'); $vtc->constructTestCase(); - + $fs = $vtc->toString(); $this->assertTrue(is_string($fs)); - + } } ?> \ No newline at end of file diff --git a/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php b/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php index d99b6562d0048..a074fcceeb390 100644 --- a/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php +++ b/scripts/dev/generate-phpt/tests/gtVariationTestCaseMethodTest.php @@ -5,23 +5,23 @@ class gtVariationTestCaseMethodTest extends PHPUnit_Framework_TestCase { public function testTestCase() { - + $f = new gtMethod('DOMDocument','createAttribute'); $f->setArgumentNames(); $f->setArgumentLists(); $f->setConstructorArgumentNames(); $f->setConstructorInitStatements(); - + $optSect = new gtOptionalSections(); - + $vtc = gtVariationTestCase::getInstance($optSect, 'method'); $vtc->setUp($f, 1, 'int'); $vtc->constructTestCase(); $fs = $vtc->toString(); - + $this->assertTrue(is_string($fs)); - + } } ?> \ No newline at end of file diff --git a/server-tests-config.php b/server-tests-config.php index 5961deea9828b..645a5e8e98262 100755 --- a/server-tests-config.php +++ b/server-tests-config.php @@ -6,7 +6,7 @@ that are directly executed, so you can also set things like PHPRC here to force an executable to use a specific php.ini file. */ - + $conf = array( /* path to the php source tree */ 'TEST_PHP_SRCDIR' => NULL, @@ -43,7 +43,7 @@ TEST_WEB_BASE_URL should be the base url pointing to TEST_PHP_SRCDIR, which should then be accessible via an http server. - + An example would be: TEST_WEB_BASE_URL=http://localhost/test TEST_BASE_PATH=/path/to/htdocs/test diff --git a/server-tests.php b/server-tests.php index ff4b9f6ffc3e7..f914b011871ff 100755 --- a/server-tests.php +++ b/server-tests.php @@ -154,13 +154,13 @@ function post_result_data($query,$data) $post = "php_test_data=" . urlencode(base64_encode(preg_replace("/[\\x00]/", "[0x0]", $data))); $r = new HTTPRequest($url,NULL,NULL,$post); return $this->response_headers['Status']=='200'; -} +} function execute($command, $args=NULL, $input=NULL, $cwd=NULL, $env=NULL) { $data = ""; - + if (gettype($args)=='array') { $args = join($args,' '); } @@ -179,7 +179,7 @@ function execute($command, $args=NULL, $input=NULL, $cwd=NULL, $env=NULL) return NULL; } } - + fclose($pipes[0]); while (true) { @@ -247,7 +247,7 @@ class HTTPRequest /* URL is the full url headers is assoc array of outgoing http headers - + options may include timeout proxy_host @@ -255,7 +255,7 @@ class HTTPRequest proxy_user proxy_pass method (GET|POST) - + post data is, well, post data. It is not processed so multipart stuff must be prepared before calling this (or add it to class) @@ -269,14 +269,14 @@ function HTTPRequest($URL, $headers=array(), $options=array(), $postdata=NULL) $this->postdata = &$postdata; $this->doRequest(); } - + function doRequest() { if (!$this->_validateUrl()) return; - - if (isset($this->options['timeout'])) + + if (isset($this->options['timeout'])) $this->timeout = (int)$this->options['timeout']; - + $this->_sendHTTP(); } @@ -295,7 +295,7 @@ function _validateUrl() $this->urlparts['path'] = '/'; return TRUE; } - + function _parseResponse() { if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $this->incoming_payload, $match)) { @@ -319,7 +319,7 @@ function _parseResponse() $this->errmsg = 'Invalid HTTP Response'; return FALSE; } - + function &_getRequest() { $fullpath = $this->urlparts['path']. @@ -343,13 +343,13 @@ function &_getRequest() $headertext .= "$k: $v\r\n"; } $method = trim($this->options['method'])?strtoupper(trim($this->options['method'])):'GET'; - $this->outgoing_payload = + $this->outgoing_payload = "$method $fullpath HTTP/1.0\r\n". $headertext."\r\n". $this->postdata; return $this->outgoing_payload; } - + function _sendHTTP() { $this->_getRequest(); @@ -378,7 +378,7 @@ function _sendHTTP() $this->errmsg = "Error Sending Request Data to $host"; return NULL; } - + while ($data = fread($fp, 32768)) { $this->incoming_payload .= $data; } @@ -422,7 +422,7 @@ class testHarness { 'w' => array('TEST_WEB' ,'' ,0 ,'run tests via http'), 'x' => array('TEST_WEB_EXT' ,'file ext' ,'php' ,'http file extension to use') ); - + public $conf = array(); public $test_to_run = array(); public $test_files = array(); @@ -439,7 +439,7 @@ class testHarness { public $test_executable_iscgi = false; public $inisettings; // the test executables settings, used for web tests public $iswin32 = false; - + public $ddash = "====================================================================="; public $sdash = "---------------------------------------------------------------------"; @@ -463,7 +463,7 @@ class testHarness { 'error_append_string'=>'', 'auto_prepend_file'=>'', 'auto_append_file'=>'', - ); + ); public $env = array(); public $info_params = array(); @@ -472,7 +472,7 @@ function testHarness() { $this->checkRequirements(); $this->env = $_ENV; $this->removeSensitiveEnvVars(); - + $this->initializeConfiguration(); $this->parseArgs(); $this->setTestPaths(); @@ -490,13 +490,13 @@ function testHarness() { $this->conf['TEST_PHP_SRCDIR'] = str_replace('/','\\',$this->conf['TEST_PHP_SRCDIR']); $this->conf['TEST_BASE_PATH'] = str_replace('/','\\',$this->conf['TEST_BASE_PATH']); } - + if (!$this->conf['TEST_WEB'] && !is_executable($this->conf['TEST_PHP_EXECUTABLE'])) { $this->error("invalid PHP executable specified by TEST_PHP_EXECUTABLE = " . $this->conf['TEST_PHP_EXECUTABLE']); return false; } - + $this->getInstalledExtensions(); $this->getExecutableInfo(); $this->getExecutableIniSettings(); @@ -506,11 +506,11 @@ function testHarness() { // add TEST_PHP_SRCDIR to the include path, this facilitates // tests including files from src/tests //$this->ini_overwrites['include_path'] = $this->cwd.($this->iswin32?';.;':':.:').$this->exec_info['INCLUDE_PATH']; - + $params = array(); settings2array($this->ini_overwrites,$params); $this->info_params = settings2params($params); - + $this->contextHeader(); if ($this->conf['TEST_CONTEXT_INFO']) return; $this->loadFileList(); @@ -524,7 +524,7 @@ function getExecutableIniSettings() $out = $this->runscript(PHP_INI_SETTINGS_SCRIPT,true); $this->inisettings = unserialize($out); } - + function getExecutableInfo() { $out = $this->runscript(PHP_INFO_SCRIPT,true); @@ -540,7 +540,7 @@ function getExecutableInfo() } $this->exec_info = $info; } - + function getInstalledExtensions() { // get the list of installed extensions @@ -579,21 +579,21 @@ function runscript($script,$removeheaders=false,$cwd=NULL) } } - + // Use this function to do any displaying of text, so that // things can be over-written as necessary. - + function writemsg($msg) { - + echo $msg; - + } - + // Another wrapper function, this one should be used any time // a particular test passes or fails - + function showstatus($item, $status, $reason = '') { - + switch($status) { case 'PASSED': $this->writemsg("PASSED: $item ($reason)\n"); @@ -606,8 +606,8 @@ function showstatus($item, $status, $reason = '') { break; } } - - + + function help() { $usage = "usage: php run-tests.php [options]\n"; @@ -616,17 +616,17 @@ function help() } return $usage; } - + function parseArgs() { global $argc; global $argv; global $_SERVER; - + if (!isset($argv)) { $argv = $_SERVER['argv']; $argc = $_SERVER['argc']; } - + $conf = NULL; for ($i=1; $i<$argc;) { if ($argv[$i][0] != '-') continue; @@ -661,7 +661,7 @@ function parseArgs() { break; } } - + // set config into environment, this allows // executed tests to find out about the test // configurations. config file or args overwrite @@ -680,14 +680,14 @@ function removeSensitiveEnvVars() $this->env['SSH_AUTH_SOCK']='deleted'; $this->env['SSH_TTY']='deleted'; } - + function setEnvConfigVar($name) { if (isset($this->env[$name])) { $this->conf[$name] = $this->env[$name]; } } - + function initializeConfiguration() { foreach ($this->xargs as $arg=>$arg_info) { @@ -715,7 +715,7 @@ function setTestPaths() } } } - + function test_sort($a, $b) { $ta = strpos($a, "{$this->cwd}/tests")===0 ? 1 + (strpos($a, "{$this->cwd}/tests/run-test")===0 ? 1 : 0) : 0; $tb = strpos($b, "{$this->cwd}/tests")===0 ? 1 + (strpos($b, "{$this->cwd}/tests/run-test")===0 ? 1 : 0) : 0; @@ -745,7 +745,7 @@ function checkRequirements() { exit; } } - + // // Write test context information. // @@ -767,12 +767,12 @@ function contextHeader() foreach ($this->conf as $k=>$v) { $conf .= sprintf("%-20.s: %s\n",$k,$v); } - + $exeinfo = ''; if (!$this->conf['TEST_WEB']) $exeinfo = "CWD : {$this->cwd}\n". "PHP : {$this->conf['TEST_PHP_EXECUTABLE']}\n"; - + $this->writemsg("\n$this->ddash\n". "$exeinfo$info\n". "Test Harness Configuration:\n$conf\n". @@ -780,7 +780,7 @@ function contextHeader() "Test Dirs : $dirs\n". "$this->ddash\n"); } - + function loadFileList() { foreach ($this->test_dirs as $dir) { @@ -793,7 +793,7 @@ function loadFileList() usort($this->test_files,array($this,"test_sort")); $this->writemsg("found ".count($this->test_files)." files\n"); } - + function moveTestFiles() { if (!$this->conf['TEST_BASE_PATH'] || @@ -819,7 +819,7 @@ function moveTestFiles() } $this->test_files = $files; } - + function findFilesInDir($dir,$is_ext_dir=FALSE,$ignore=FALSE) { $skip = array('.', '..', 'CVS'); @@ -833,13 +833,13 @@ function findFilesInDir($dir,$is_ext_dir=FALSE,$ignore=FALSE) } $this->findFilesInDir("$dir/$name", FALSE, $ignore || $skip_ext); } - + // Cleanup any left-over tmp files from last run. if (substr($name, -4) == '.tmp') { @unlink("$dir/$name"); continue; } - + // Otherwise we're only interested in *.phpt files. if (substr($name, -5) == '.phpt') { if ($ignore) { @@ -852,7 +852,7 @@ function findFilesInDir($dir,$is_ext_dir=FALSE,$ignore=FALSE) } closedir($o); } - + function runHeader() { $this->writemsg("TIME START " . date('Y-m-d H:i:s', $this->start_time) . "\n".$this->ddash."\n"); @@ -862,14 +862,14 @@ function runHeader() $this->writemsg("Running all test files.\n"); } } - + function run() { $this->start_time = time(); $this->runHeader(); // Run selected tests. if (count($this->test_to_run)) { - + foreach($this->test_to_run as $name=>$runnable) { if(!preg_match("/\.phpt$/", $name)) continue; @@ -891,10 +891,10 @@ function summarizeResults() $this->writemsg("No tests were run.\n"); return; } - + $n_total = count($this->test_results); $n_total += $this->ignored_by_ext; - + $sum_results = array('PASSED'=>0, 'SKIPPED'=>0, 'FAILED'=>0); foreach ($this->test_results as $v) { $sum_results[$v]++; @@ -904,7 +904,7 @@ function summarizeResults() foreach ($sum_results as $v => $n) { $percent_results[$v] = (100.0 * $n) / $n_total; } - + $this->writemsg("\n".$this->ddash."\n". "TIME END " . date('Y-m-d H:i:s', $this->end_time) . "\n". $this->ddash."\n". @@ -920,7 +920,7 @@ function summarizeResults() $this->sdash."\n". "Time taken : " . sprintf("%4d seconds", $this->end_time - $this->start_time) . "\n". $this->ddash."\n"); - + $failed_test_summary = ''; if ($this->failed_tests) { $failed_test_summary .= "\n".$this->ddash."\n". @@ -930,7 +930,7 @@ function summarizeResults() } $failed_test_summary .= $this->ddash."\n"; } - + if ($failed_test_summary && !$this->conf['NO_PHPTEST_SUMMARY']) { $this->writemsg($failed_test_summary); } @@ -944,9 +944,9 @@ function summarizeResults() flush(); $user_input = fgets($fp, 10); $just_save_results = (strtolower($user_input[0]) == 's'); - + if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') { - /* + /* * Collect information about the host system for our report * Fetch phpinfo() output so that we can see the PHP environment * Make an archive of all the failed tests @@ -961,12 +961,12 @@ function summarizeResults() $user_email = trim(fgets($fp, 1024)); $user_email = str_replace("@", " at ", str_replace(".", " dot ", $user_email)); } - + $failed_tests_data = ''; $sep = "\n" . str_repeat('=', 80) . "\n"; - + $failed_tests_data .= $failed_test_summary . "\n"; - + if (array_sum($this->failed_tests)) { foreach ($this->failed_tests as $test_info) { $failed_tests_data .= $sep . $test_info['name']; @@ -978,7 +978,7 @@ function summarizeResults() } else { $status = "success"; } - + $failed_tests_data .= "\n" . $sep . 'BUILD ENVIRONMENT' . $sep; $failed_tests_data .= "OS:\n". PHP_OS. "\n\n"; $automake = $autoconf = $libtool = $compiler = 'N/A'; @@ -999,7 +999,7 @@ function summarizeResults() } } } - + $failed_tests_data .= "Automake:\n$automake\n"; $failed_tests_data .= "Autoconf:\n$autoconf\n"; $failed_tests_data .= "Libtool:\n$libtool\n"; @@ -1013,7 +1013,7 @@ function summarizeResults() $failed_tests_data .= $sep . "PHPINFO" . $sep; $failed_tests_data .= shell_exec($this->conf['TEST_PHP_EXECUTABLE'].' -dhtml_errors=0 -i'); - + $compression = 0; if ($just_save_results || @@ -1022,7 +1022,7 @@ function summarizeResults() $fp = fopen($output_file, "w"); fwrite($fp, $failed_tests_data); fclose($fp); - + if (!$just_save_results) echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n"; echo "Please send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n"; @@ -1032,7 +1032,7 @@ function summarizeResults() } } } - + if($this->conf['REPORT_EXIT_STATUS'] and $sum_results['FAILED']) { exit(1); } @@ -1041,7 +1041,7 @@ function summarizeResults() function getINISettings(&$section_text) { $ini_settings = $this->ini_overwrites; - // Any special ini settings + // Any special ini settings // these may overwrite the test defaults... if (array_key_exists('INI', $section_text)) { settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings); @@ -1090,11 +1090,11 @@ function evalSettings($filename,$data) { // eval fails if no newline return eval("$data\n"); } - + function getENVSettings(&$section_text,$testfile) { $env = $this->env; - // Any special environment settings + // Any special environment settings // these may overwrite the test defaults... if (array_key_exists('ENV', $section_text)) { $sect = $this->evalSettings($testfile,$section_text['ENV']); @@ -1107,7 +1107,7 @@ function getENVSettings(&$section_text,$testfile) function getEvalTestSettings($section_text,$testfile) { $rq = array(); - // Any special environment settings + // Any special environment settings // these may overwrite the test defaults... if ($section_text) { $sect = $this->evalSettings($testfile,$section_text); @@ -1116,7 +1116,7 @@ function getEvalTestSettings($section_text,$testfile) } return $rq; } - + // // Load the sections of the test file. // @@ -1131,10 +1131,10 @@ function getSectionText($file) '_FILE' => $file, '_DIR' => realpath(dirname($file)), ); - + $fp = @fopen($file, "r") or $this->error("Cannot open test file: $file"); - + $section = ''; while (!feof($fp)) { $line = fgets($fp); @@ -1144,7 +1144,7 @@ function getSectionText($file) $section_text[$section] = ''; continue; } - + // Add to the section text. $section_text[$section] .= $line; } @@ -1199,7 +1199,7 @@ function getSkipReason($file,&$section_text,$docgi=false) if ($this->conf['TEST_PHP_DETAILED'] > 2) print "SKIPIF: [$output]\n"; if (preg_match("/^skip/i", $output)){ - + $reason = (preg_match("/^skip\s*(.+)\$/", $output)) ? preg_replace("/^skip\s*(.+)\$/", "\\1", $output) : FALSE; $this->showstatus($section_text['TEST'], 'SKIPPED', $reason); return 'SKIPPED'; @@ -1221,15 +1221,15 @@ function run_test($file) { if ($this->conf['TEST_PHP_DETAILED']) $this->writemsg("\n=================\nTEST $file\n"); - + $section_text = $this->getSectionText($file); - + if ($this->iswin32) $shortname = str_replace($this->conf['TEST_BASE_PATH'].'\\', '', $file); else $shortname = str_replace($this->conf['TEST_BASE_PATH'].'/', '', $file); $tested = $section_text['TEST']." [$shortname]"; - + if ($this->conf['TEST_WEB']) { $tmp_file = preg_replace('/\.phpt$/','.'.$this->conf['TEST_WEB_EXT'],$file); $uri = $this->conf['TEST_BASE_SCRIPT_NAME'].str_replace($this->conf['TEST_BASE_PATH'], '', $tmp_file); @@ -1238,19 +1238,19 @@ function run_test($file) $tmp_file = preg_replace('/\.phpt$/','.php',$file); } @unlink($tmp_file); - - // unlink old test results + + // unlink old test results @unlink(preg_replace('/\.phpt$/','.diff',$file)); @unlink(preg_replace('/\.phpt$/','.log',$file)); @unlink(preg_replace('/\.phpt$/','.exp',$file)); @unlink(preg_replace('/\.phpt$/','.out',$file)); - + if (!$this->conf['TEST_WEB']) { // Reset environment from any previous test. $env = $this->getENVSettings($section_text,$tmp_file); $ini_overwrites = $this->getINIParams($section_text); } - + // if this is a cgi test, prepare for it $query_string = ''; $havepost = array_key_exists('POST', $section_text) && !empty($section_text['POST']); @@ -1276,7 +1276,7 @@ function run_test($file) $method = isset($request['method'])?$request['method']:$havepost?'POST':'GET'; $query_string = $haveget?$section_text['GET']:''; - + $options = array(); $options['method']=$method; if (isset($this->conf['timeout'])) $options['timeout'] = $this->conf['timeout']; @@ -1284,7 +1284,7 @@ function run_test($file) if (isset($this->conf['proxy_port'])) $options['proxy_port'] = $this->conf['proxy_port']; if (isset($this->conf['proxy_user'])) $options['proxy_user'] = $this->conf['proxy_user']; if (isset($this->conf['proxy_pass'])) $options['proxy_pass'] = $this->conf['proxy_pass']; - + $post = $havepost?$section_text['POST']:NULL; $url = $this->conf['TEST_SERVER_URL']; if (isset($request['SCRIPT_NAME'])) @@ -1303,7 +1303,7 @@ function run_test($file) $this->writemsg("\nURL = $url\n"); } else if ($do_cgi) { $query_string = $haveget?$section_text['GET']:''; - + if (!array_key_exists('GATEWAY_INTERFACE', $env)) $env['GATEWAY_INTERFACE']='CGI/1.1'; if (!array_key_exists('SERVER_SOFTWARE', $env)) @@ -1327,7 +1327,7 @@ function run_test($file) $env['SCRIPT_NAME']=''; if (!array_key_exists('SCRIPT_FILENAME', $env)) $env['SCRIPT_FILENAME']=''; - + if (array_key_exists('POST', $section_text) && (!$haveget || !empty($section_text['POST']))) { $post = $section_text['POST']; $content_length = strlen($post); @@ -1346,14 +1346,14 @@ function run_test($file) $env['CONTENT_LENGTH']=''; } if ($this->conf['TEST_PHP_DETAILED'] > 1) - $this->writemsg("\nCONTENT_LENGTH = " . $env['CONTENT_LENGTH'] . - "\nCONTENT_TYPE = " . $env['CONTENT_TYPE'] . - "\nPATH_TRANSLATED = " . $env['PATH_TRANSLATED'] . - "\nPATH_INFO = " . $env['PATH_INFO'] . - "\nQUERY_STRING = " . $env['QUERY_STRING'] . - "\nREDIRECT_STATUS = " . $env['REDIRECT_STATUS'] . - "\nREQUEST_METHOD = " . $env['REQUEST_METHOD'] . - "\nSCRIPT_NAME = " . $env['SCRIPT_NAME'] . + $this->writemsg("\nCONTENT_LENGTH = " . $env['CONTENT_LENGTH'] . + "\nCONTENT_TYPE = " . $env['CONTENT_TYPE'] . + "\nPATH_TRANSLATED = " . $env['PATH_TRANSLATED'] . + "\nPATH_INFO = " . $env['PATH_INFO'] . + "\nQUERY_STRING = " . $env['QUERY_STRING'] . + "\nREDIRECT_STATUS = " . $env['REDIRECT_STATUS'] . + "\nREQUEST_METHOD = " . $env['REQUEST_METHOD'] . + "\nSCRIPT_NAME = " . $env['SCRIPT_NAME'] . "\nSCRIPT_FILENAME = " . $env['SCRIPT_FILENAME'] . "\n"); /* not cgi spec to put query string on command line, but used by a couple tests to catch a security hole @@ -1390,14 +1390,14 @@ function run_test($file) } } } - + if ($this->conf['TEST_PHP_DETAILED'] > 2) { echo "HEADERS: "; print_r($headers); echo "OUTPUT: \n$out\n"; - + } - + // Does the output match what is expected? $output = trim($out); $output = preg_replace('/\r\n/',"\n",$output); @@ -1473,7 +1473,7 @@ function run_test($file) $wanted_re = str_replace('%f', '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', $wanted_re); $wanted_re = str_replace('%c', '.', $wanted_re); // %f allows two points "-.0.0" but that is the best *simple* expression - + } /* DEBUG YOUR REGEX HERE var_dump($wanted_re); @@ -1482,7 +1482,7 @@ function run_test($file) */ $failed = !preg_match("/^$wanted_re\$/s", $output); } - + $skipexpect = false; if (!$failed && $this->conf['TEST_WEB'] && isset($section_text['EXPECTHEADERS'])) { $want = array(); @@ -1502,7 +1502,7 @@ function run_test($file) $failed = TRUE; } } - + // different servers may do different things on non-200 results // for instance, IIS will deliver it's own error pages, so we // cannot expect to match up the EXPECT section. We may however, @@ -1510,50 +1510,50 @@ function run_test($file) // need to change later. $skipexpect = isset($headers['Status']) && $headers['Status'] != 200; } - + if (!$failed && !$skipexpect && isset($section_text['EXPECT'])) { $wanted = $section_text['EXPECT']; $wanted = preg_replace('/\r\n/',"\n",$wanted); $failed = (0 != strcmp($output,$wanted)); } - + if (!$failed) { @unlink($tmp_file); $this->showstatus($tested, 'PASSED'); return 'PASSED'; } - + // Test failed so we need to report details. $this->showstatus($tested, 'FAILED'); - + $this->failed_tests[] = array( 'name' => $file, 'test_name' => $tested, 'output' => preg_replace('/\.phpt$/','.log', $file), 'diff' => preg_replace('/\.phpt$/','.diff', $file) ); - + if ($this->conf['TEST_PHP_DETAILED']) $this->writemsg(generate_diff($wanted,$output)."\n"); - + // write .exp if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'E') !== FALSE) { $logname = preg_replace('/\.phpt$/','.exp',$file); file_put_contents($logname,$wanted); } - + // write .out if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'O') !== FALSE) { $logname = preg_replace('/\.phpt$/','.out',$file); file_put_contents($logname,$output); } - + // write .diff if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'D') !== FALSE) { $logname = preg_replace('/\.phpt$/','.diff',$file); file_put_contents($logname,generate_diff($wanted,$output)); } - + // write .log if (strpos($this->conf['TEST_PHP_LOG_FORMAT'],'L') !== FALSE) { $logname = preg_replace('/\.phpt$/','.log',$file); @@ -1572,7 +1572,7 @@ function run_test($file) // // Write an error in a format recognizable to Emacs or MSVC. // - function error_report($testname,$logname,$tested) + function error_report($testname,$logname,$tested) { $testname = realpath($testname); $logname = realpath($logname); diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php index bf91b8b36093e..e71fabd7d22ea 100644 --- a/win32/build/mkdist.php +++ b/win32/build/mkdist.php @@ -68,13 +68,13 @@ function get_depends($module) "api-ms-win-crt-.+\.dll", ); global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, $pecl_targets, $phpdll, $per_module_deps, $pecl_dll_deps; - + $bd = strtolower(realpath($build_dir)); $is_pecl = in_array($module, $pecl_targets); - + $cmd = "$GLOBALS[build_dir]\\deplister.exe \"$module\" \"$GLOBALS[build_dir]\""; - $proc = proc_open($cmd, + $proc = proc_open($cmd, array(1 => array("pipe", "w")), $pipes); @@ -106,7 +106,7 @@ function get_depends($module) continue; } } - + if ($is_pecl) { if (!in_array($dep, $pecl_dll_deps)) { $pecl_dll_deps[] = $dep; @@ -199,7 +199,7 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ $hdr['size'] = octdec(trim($hdr['size'])); echo "File: $hdr[filename] $hdr[size]\n"; - + if ($filename == $hdr['filename']) { echo "Found the file we want\n"; $dest = fopen($destfilename, 'wb'); @@ -208,14 +208,14 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ echo "Wrote $x bytes into $destfilename\n"; break; } - + /* skip body of the file */ $size = 512 * ceil((int)$hdr['size'] / 512); echo "Skipping $size bytes\n"; gzseek($fp, gztell($fp) + $size); - + } while (!$done); - + } /* }}} */ @@ -247,7 +247,7 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ $text_files = array( "LICENSE" => "license.txt", "NEWS" => "news.txt", - "INSTALL" => "install.txt", + "INSTALL" => "install.txt", "README.REDIST.BINS" => "readme-redist-bins.txt", "php.ini-development" => "php.ini-development", "php.ini-production" => "php.ini-production" @@ -323,9 +323,9 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ } /* TODO: -add sanity check and test if all required DLLs are present, per version +add sanity check and test if all required DLLs are present, per version This version works at least for 3.6, 3.8 and 4.0 (5.3-vc6, 5.3-vc9 and HEAD). -Add ADD_DLLS to add extra DLLs like dynamic dependencies for standard +Add ADD_DLLS to add extra DLLs like dynamic dependencies for standard deps. For example, libenchant.dll loads libenchant_myspell.dll or libenchant_ispell.dll */ @@ -451,7 +451,7 @@ function copy_test_dir($directory, $dest) } } - closedir($directory_list); + closedir($directory_list); } function make_phar_dot_phar($dist_dir) @@ -537,7 +537,7 @@ function make_phar_dot_phar($dist_dir) extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "$dist_dir/PEAR/go-pear-bundle"); extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "$dist_dir/PEAR/go-pear-bundle"); } - + /* add extras from the template dir */ if (file_exists($snapshot_template)) { $items = glob("$snapshot_template/*"); @@ -567,7 +567,7 @@ function make_phar_dot_phar($dist_dir) } } } - + /* copy c++ runtime */ $items = glob("$snapshot_template/dlls/*.CRT");