com phpruntests: Added the binary string check for compatibility with run-tests: src/testcase/sections/outputsections/rtExpectFSection.php

From: Date: Sun, 05 Jul 2009 14:28:26 +0000
Subject: com phpruntests: Added the binary string check for compatibility with run-tests: src/testcase/sections/outputsections/rtExpectFSection.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-66378@lists.php.net to get a copy of this message
Commit: b3547cf9fb0878eeb9a04f42d104f2673bc3a1d4 Author: Zoe Slattery <zoe@php.net> Sun, 5 Jul 2009 14:28:26 +0000 Parents: 59ddd5070a2d28790547a6b8611beeed653b210f Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=b3547cf9fb0878eeb9a04f42d104f2673bc3a1d4 Log: Added the binary string check for compatibility with run-tests Changed paths: M src/testcase/sections/outputsections/rtExpectFSection.php Diff: diff --git a/src/testcase/sections/outputsections/rtExpectFSection.php b/src/testcase/sections/outputsections/rtExpectFSection.php index 03239cc..d44f757 100644 --- a/src/testcase/sections/outputsections/rtExpectFSection.php +++ b/src/testcase/sections/outputsections/rtExpectFSection.php @@ -1,7 +1,7 @@ <?php /** * rtExpectFSection - * + * * Class for handling EXPECTF sections * * @category Testing @@ -25,8 +25,8 @@ class rtExpectFSection extends rtOutputSection * */ protected function createPattern() - { - + { + $this->expectedPattern = $this->expectfEmbeddedRegex($this->expectedPattern); $this->expectedPattern = $this->expectfUnicodeSubstitutions ($this->expectedPattern); $this->expectedPattern = $this->expectfRegexSubstitutions($this->expectedPattern); @@ -56,6 +56,14 @@ class rtExpectFSection extends rtOutputSection $string ); + $string = str_replace( + array('%binary_string_optional%'), + version_compare(PHP_VERSION, '6.0.0-dev') == -1 ? 'string' : 'binary string', + $string + ); + + + return $string; } @@ -80,9 +88,9 @@ class rtExpectFSection extends rtOutputSection return $string; } - + /* - * Deal with embedded regular expressions between %r tags. + * Deal with embedded regular expressions between %r tags. * @param string * @return string */ @@ -90,7 +98,7 @@ class rtExpectFSection extends rtOutputSection $temp = ""; $r = "%r"; $startOffset = 0; - + $length = strlen($string); while($startOffset < $length) { $start = strpos($string, $r, $startOffset);

« previous php.qa (#66378) next »