From: andy wharmby Date: Sun, 18 Jan 2009 21:59:36 +0000 (+0000) Subject: New hebrev() and hebrevc() tests. Tested on Windows. Linux and Linux 64 bit X-Git-Tag: php-5.4.0alpha1~191^2~4479 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=310cc4c912e560bdf4a4566d0a4955f0dd34712d;p=php New hebrev() and hebrevc() tests. Tested on Windows. Linux and Linux 64 bit --- diff --git a/ext/standard/tests/strings/hebrev_basic.phpt b/ext/standard/tests/strings/hebrev_basic.phpt new file mode 100644 index 0000000000..81667c9ccf --- /dev/null +++ b/ext/standard/tests/strings/hebrev_basic.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test hebrev() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing hebrev() : basic functionality *** +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +string(109) "to visual text +Hebrew text +logical +converts +hebrev function +.The +breaking words +tries to avoid +.The function +" +===DONE=== diff --git a/ext/standard/tests/strings/hebrev_error.phpt b/ext/standard/tests/strings/hebrev_error.phpt new file mode 100644 index 0000000000..8abf68cd70 --- /dev/null +++ b/ext/standard/tests/strings/hebrev_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test hebrev() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing hebrev() : error conditions *** + +-- Testing hebrev() function with no arguments -- + +Warning: hebrev() expects at least 1 parameter, 0 given in %s on line %d +NULL + +-- Testing hebrev() function with more than expected no. of arguments -- + +Warning: hebrev() expects at most 2 parameters, 3 given in %s on line %d +NULL + +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/hebrev_variation1.phpt b/ext/standard/tests/strings/hebrev_variation1.phpt new file mode 100644 index 0000000000..2e887dbb92 --- /dev/null +++ b/ext/standard/tests/strings/hebrev_variation1.phpt @@ -0,0 +1,138 @@ +--TEST-- +Test hebrev() function : usage variations - test values for $hebrew_text argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing hebrev() function: with unexpected inputs for 'hebrew_text' argument *** +-- Iteration 1 -- +string(1) "0" +-- Iteration 2 -- +string(1) "1" +-- Iteration 3 -- +string(3) "255" +-- Iteration 4 -- +string(3) "256" +-- Iteration 5 -- +string(10) "2147483647" +-- Iteration 6 -- +string(11) "-2147483648" +-- Iteration 7 -- +string(4) "10.5" +-- Iteration 8 -- +string(5) "-20.5" +-- Iteration 9 -- +string(10) "1012345.67" +-- Iteration 10 -- + +Warning: hebrev() expects parameter 1 to be binary string, array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: hebrev() expects parameter 1 to be binary string, array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: hebrev() expects parameter 1 to be binary string, array given in %s on line %d +NULL +-- Iteration 13 -- +string(1) "1" +-- Iteration 14 -- +bool(false) +-- Iteration 15 -- +string(1) "1" +-- Iteration 16 -- +bool(false) +-- Iteration 17 -- +bool(false) +-- Iteration 18 -- +bool(false) +-- Iteration 19 -- +string(13) "sample object" +-- Iteration 20 -- + +Warning: hebrev() expects parameter 1 to be binary string, resource given in %s on line %d +NULL +-- Iteration 21 -- +bool(false) +-- Iteration 22 -- +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/hebrev_variation2.phpt b/ext/standard/tests/strings/hebrev_variation2.phpt new file mode 100644 index 0000000000..f22b6b48d5 --- /dev/null +++ b/ext/standard/tests/strings/hebrev_variation2.phpt @@ -0,0 +1,291 @@ +--TEST-- +Test hebrev() function : usage variations - test values for $max_chars_per_line argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing hebrev() function: with unexpected inputs for 'max_chars_per_line' argument *** +-- Iteration 1 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 2 -- +string(109) "xttel uaisv +tot ext +ewbrHel cagilos rtveonc +ontincfuv reebh +he.Ts +rdwog inakreb +idvoa +tos ietrn ioctunf +he.T +" +-- Iteration 3 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 4 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 5 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 6 -- +string(109) "txet +lausiv +ot +txet +werbeH +lacigol +strevnoc +noitcnuf +verbeh +ehT. +sdrow +gnikaerb +diova +ot +seirt +noitcnuf +ehT. +" +-- Iteration 7 -- +string(109) "text +to visual +text +Hebrew +logical +converts +function +hebrev +.The +words +breaking +to avoid +tries +function +.The +" +-- Iteration 8 -- +string(109) "txet +lausiv +ot +txet +werbeH +lacigol +strevnoc +noitcnuf +verbeh +ehT. +sdrow +gnikaerb +diova +ot +seirt +noitcnuf +ehT. +" +-- Iteration 9 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 10 -- + +Warning: hebrev() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: hebrev() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: hebrev() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 13 -- +string(109) "xttel uaisv +tot ext +ewbrHel cagilos rtveonc +ontincfuv reebh +he.Ts +rdwog inakreb +idvoa +tos ietrn ioctunf +he.T +" +-- Iteration 14 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 15 -- +string(109) "xttel uaisv +tot ext +ewbrHel cagilos rtveonc +ontincfuv reebh +he.Ts +rdwog inakreb +idvoa +tos ietrn ioctunf +he.T +" +-- Iteration 16 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 17 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 18 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 19 -- + +Warning: hebrev() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 20 -- + +Warning: hebrev() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 21 -- + +Notice: A non well formed numeric value encountered in %s on line %d +string(109) "textual vis +to +textrew Heb +icallog +ertsconvion unctf +brevhe +.Therds +wo +kingbreaoid av +to +riest +tionfuncThe . +" +-- Iteration 22 -- + +Notice: A non well formed numeric value encountered in %s on line %d +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 23 -- +string(109) "textual vis +to +textrew Heb +icallog +ertsconvion unctf +brevhe +.Therds +wo +kingbreaoid av +to +riest +tionfuncThe . +" +-- Iteration 24 -- + +Warning: hebrev() expects parameter 2 to be long, object given in %s on line %d +NULL +-- Iteration 25 -- + +Warning: hebrev() expects parameter 2 to be long, resource given in %s on line %d +NULL +-- Iteration 26 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +-- Iteration 27 -- +string(109) ".The hebrev function converts logical Hebrew text to visual text +.The function tries to avoid breaking words +" +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/hebrevc_basic.phpt b/ext/standard/tests/strings/hebrevc_basic.phpt new file mode 100644 index 0000000000..fe8557727e --- /dev/null +++ b/ext/standard/tests/strings/hebrevc_basic.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test hebrevc() function : basic functionality +--FILE-- +\n'.\nThe function tries to avoid breaking words.\n"; + +var_dump(hebrevc($hebrew_text)); +var_dump(hebrevc($hebrew_text, 15)); + +?> +===DONE=== +--EXPECTF-- +*** Testing hebrevc() : basic functionality *** +string(239) ".The hebrevc function converts logical Hebrew text to visual text
+) This function is similar to hebrev() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +string(317) "to visual text
+Hebrew text
+logical
+converts
+function
+.The hebrevc
+newlines
+it converts
+difference that
+with the
+to hebrev()
+is similar
+) This function
+ +.'
+breaking words
+tries to avoid
+.The function
+" +===DONE=== diff --git a/ext/standard/tests/strings/hebrevc_error.phpt b/ext/standard/tests/strings/hebrevc_error.phpt new file mode 100644 index 0000000000..f75abb3a4d --- /dev/null +++ b/ext/standard/tests/strings/hebrevc_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test hebrevc() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing hebrevc() : error conditions *** + +-- Testing hebrevc() function with no arguments -- + +Warning: hebrevc() expects at least 1 parameter, 0 given in %s on line %d +NULL + +-- Testing hebrevc() function with more than expected no. of arguments -- + +Warning: hebrevc() expects at most 2 parameters, 3 given in %s on line %d +NULL + +===DONE=== diff --git a/ext/standard/tests/strings/hebrevc_variation1.phpt b/ext/standard/tests/strings/hebrevc_variation1.phpt new file mode 100644 index 0000000000..2cc9355c86 --- /dev/null +++ b/ext/standard/tests/strings/hebrevc_variation1.phpt @@ -0,0 +1,138 @@ +--TEST-- +Test hebrevc() function : usage variations - test values for $hebrew_text argument +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing hebrevc() function: with unexpected inputs for 'hebrew_text' argument *** +-- Iteration 1 -- +string(1) "0" +-- Iteration 2 -- +string(1) "1" +-- Iteration 3 -- +string(3) "255" +-- Iteration 4 -- +string(3) "256" +-- Iteration 5 -- +string(10) "2147483647" +-- Iteration 6 -- +string(11) "-2147483648" +-- Iteration 7 -- +string(4) "10.5" +-- Iteration 8 -- +string(5) "-20.5" +-- Iteration 9 -- +string(10) "1012345.67" +-- Iteration 10 -- + +Warning: hebrevc() expects parameter 1 to be binary string, array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: hebrevc() expects parameter 1 to be binary string, array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: hebrevc() expects parameter 1 to be binary string, array given in %s on line %d +NULL +-- Iteration 13 -- +string(1) "1" +-- Iteration 14 -- +bool(false) +-- Iteration 15 -- +string(1) "1" +-- Iteration 16 -- +bool(false) +-- Iteration 17 -- +bool(false) +-- Iteration 18 -- +bool(false) +-- Iteration 19 -- +string(13) "sample object" +-- Iteration 20 -- + +Warning: hebrevc() expects parameter 1 to be binary string, resource given in %s on line %d +NULL +-- Iteration 21 -- +bool(false) +-- Iteration 22 -- +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/hebrevc_variation2.phpt b/ext/standard/tests/strings/hebrevc_variation2.phpt new file mode 100644 index 0000000000..664d2436cf --- /dev/null +++ b/ext/standard/tests/strings/hebrevc_variation2.phpt @@ -0,0 +1,430 @@ +--TEST-- +Test hebrevc() function : usage variations - test values for $max_chars_per_line argument +--FILE-- +\n'.\nThe function tries to avoid breaking words.\n"; + +foreach($inputs as $max_chars_per_line) { + echo "-- Iteration $count --\n"; + var_dump( hebrevc($hebrew_text, $max_chars_per_line) ); + $count ++; +} + +fclose($file_handle); //closing the file handle + +?> +===DONE=== +--EXPECTF-- +*** Testing hebrevc() function: with unexpected inputs for 'max_chars_per_line' argument *** +-- Iteration 1 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 2 -- +string(331) "xttel uaisv
+tot ext
+ewbrHel cagilos rtveonc
+ontincfuc vcreebh
+he.Ts
+neliewn
+tsernvcot i
+atthe ncrefeifd
+het
+thwi) c(evbrheo t
+arilims
+isn ioctunf
+isTh) (
+r +to<
+.'s
+rdwog inakreb
+idvoa
+tos ietrn ioctunf
+he.T
+" +-- Iteration 3 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 4 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 5 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 6 -- +string(421) "txet
+lausiv
+ot
+txet
+werbeH
+lacigol
+strevnoc
+noitcnuf
+ccverbeh
+ehT.
+senilwen
+strevnoc
+ti
+taht
+ecnereffid
+eht
+htiw
+)(cverbeh
+ot
+ralimis
+si
+noitcnuf
+sihT
+)
+(
+rb<'
+ot<
+'.
+sdrow
+gnikaerb
+diova
+ot
+seirt
+noitcnuf
+ehT.
+" +-- Iteration 7 -- +string(373) "text
+to visual
+text
+Hebrew
+logical
+converts
+function
+hebrevcc
+.The
+newlines
+converts
+that it
+difference
+with the
+hebrevc()
+similar to
+is
+function
+) This
+ +.'
+words
+breaking
+to avoid
+tries
+function
+.The
+" +-- Iteration 8 -- +string(421) "txet
+lausiv
+ot
+txet
+werbeH
+lacigol
+strevnoc
+noitcnuf
+ccverbeh
+ehT.
+senilwen
+strevnoc
+ti
+taht
+ecnereffid
+eht
+htiw
+)(cverbeh
+ot
+ralimis
+si
+noitcnuf
+sihT
+)
+(
+rb<'
+ot<
+'.
+sdrow
+gnikaerb
+diova
+ot
+seirt
+noitcnuf
+ehT.
+" +-- Iteration 9 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 10 -- + +Warning: hebrevc() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 11 -- + +Warning: hebrevc() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 12 -- + +Warning: hebrevc() expects parameter 2 to be long, array given in %s on line %d +NULL +-- Iteration 13 -- +string(331) "xttel uaisv
+tot ext
+ewbrHel cagilos rtveonc
+ontincfuc vcreebh
+he.Ts
+neliewn
+tsernvcot i
+atthe ncrefeifd
+het
+thwi) c(evbrheo t
+arilims
+isn ioctunf
+isTh) (
+r +to<
+.'s
+rdwog inakreb
+idvoa
+tos ietrn ioctunf
+he.T
+" +-- Iteration 14 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 15 -- +string(331) "xttel uaisv
+tot ext
+ewbrHel cagilos rtveonc
+ontincfuc vcreebh
+he.Ts
+neliewn
+tsernvcot i
+atthe ncrefeifd
+het
+thwi) c(evbrheo t
+arilims
+isn ioctunf
+isTh) (
+r +to<
+.'s
+rdwog inakreb
+idvoa
+tos ietrn ioctunf
+he.T
+" +-- Iteration 16 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 17 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 18 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 19 -- + +Warning: hebrevc() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 20 -- + +Warning: hebrevc() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +-- Iteration 21 -- + +Notice: A non well formed numeric value encountered in %s on line %d +string(349) "textual vis
+to
+textrew Heb
+icallog
+ertsconvion unctf
+evcchebrThe .
+inesnewlrts onvec
+it
+thatnce feredif
+the
+withc() brevhe
+to
+ilarsim
+is
+tionfunchis ) T
+(
+' +
+ordsw
+kingbreaoid av
+to
+riest
+tionfuncThe .
+" +-- Iteration 22 -- + +Notice: A non well formed numeric value encountered in %s on line %d +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 23 -- +string(349) "textual vis
+to
+textrew Heb
+icallog
+ertsconvion unctf
+evcchebrThe .
+inesnewlrts onvec
+it
+thatnce feredif
+the
+withc() brevhe
+to
+ilarsim
+is
+tionfunchis ) T
+(
+' +
+ordsw
+kingbreaoid av
+to
+riest
+tionfuncThe .
+" +-- Iteration 24 -- + +Warning: hebrevc() expects parameter 2 to be long, object given in %s on line %d +NULL +-- Iteration 25 -- + +Warning: hebrevc() expects parameter 2 to be long, resource given in %s on line %d +NULL +-- Iteration 26 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +-- Iteration 27 -- +string(241) ".The hebrevcc function converts logical Hebrew text to visual text
+) This function is similar to hebrevc() with the difference that it converts newlines
+ +.'
+.The function tries to avoid breaking words
+" +===DONE=== \ No newline at end of file