robinf          Thu Dec 18 15:20:10 2008 UTC

  Modified files:              
    /php-src/tests/output       ob_start_basic_004.phpt 
                                ob_end_clean_basic_001.phpt 
                                ob_flush_basic_001.phpt 
                                ob_start_basic_002.phpt 
                                ob_clean_error_001.phpt 
                                ob_implicit_flush_basic_002.phpt 
                                ob_get_clean_basic_002.phpt 
                                ob_start_error_005.phpt 
                                ob_start_error_003.phpt 
                                ob_start_error_001.phpt 
                                ob_implicit_flush_error_001.phpt 
                                ob_get_contents_basic_001.phpt 
                                ob_get_level_basic_001.phpt 
                                ob_end_flush_error_001.phpt 
                                ob_get_clean_error_001.phpt 
                                ob_start_basic_unerasable_005.phpt 
                                ob_start_basic_unerasable_003.phpt 
                                flush_error_001.phpt 
                                ob_start_basic_unerasable_001.phpt 
                                ob_clean_basic_001.phpt 
                                ob_implicit_flush_variation_001.phpt 
                                ob_start_basic_005.phpt 
                                ob_start_basic_003.phpt 
                                ob_implicit_flush_basic_001.phpt 
                                ob_start_basic_001.phpt 
                                ob_get_length_error_001.phpt 
                                ob_get_clean_basic_001.phpt 
                                ob_end_flush_basic_001.phpt 
                                ob_start_error_004.phpt 
                                ob_end_clean_error_001.phpt 
                                ob_flush_error_001.phpt 
                                ob_start_error_002.phpt 
                                ob_get_contents_error_001.phpt 
                                ob_get_level_error_001.phpt 
                                flush_basic_001.phpt 
                                ob_start_basic_unerasable_004.phpt 
                                ob_start_basic_unerasable_002.phpt 
                                ob_start_basic_006.phpt 
                                ob_get_length_basic_001.phpt 
  Log:
  Additional output buffering tests.
  
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_004.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_004.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_004.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,124 @@
+--TEST--
+ob_start() chunk_size: confirm buffer is flushed after any output call that 
causes its length to equal or exceed chunk_size.
+--XFAIL--
+Special behaviour when chunk_size set to 1 is not honoured on PHP6. See bug 
46903.
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+function callback($string) {
+       global $callback_invocations;
+       $callback_invocations++;
+       $len = strlen($string);
+       return "f[call:$callback_invocations; len:$len]$string\n";
+}
+
+for ($cs=-1; $cs<10; $cs++) {
+  echo "\n----( chunk_size: $cs, output append size: 1 )----\n";
+  $callback_invocations=0;
+  ob_start('callback', $cs);
+  echo '1'; echo '2'; echo '3'; echo '4'; echo '5'; echo '6'; echo '7'; echo 
'8';
+  ob_end_flush();
+}
+
+for ($cs=-1; $cs<10; $cs++) {
+  echo "\n----( chunk_size: $cs, output append size: 4 )----\n";
+  $callback_invocations=0;
+  ob_start('callback', $cs);
+  echo '1234'; echo '5678';
+  ob_end_flush();
+}
+
+?>
+--EXPECTF--
+
+----( chunk_size: -1, output append size: 1 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 0, output append size: 1 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 1, output append size: 1 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 2, output append size: 1 )----
+f[call:1; len:2]12
+f[call:2; len:2]34
+f[call:3; len:2]56
+f[call:4; len:2]78
+f[call:5; len:0]
+
+----( chunk_size: 3, output append size: 1 )----
+f[call:1; len:3]123
+f[call:2; len:3]456
+f[call:3; len:2]78
+
+----( chunk_size: 4, output append size: 1 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 5, output append size: 1 )----
+f[call:1; len:5]12345
+f[call:2; len:3]678
+
+----( chunk_size: 6, output append size: 1 )----
+f[call:1; len:6]123456
+f[call:2; len:2]78
+
+----( chunk_size: 7, output append size: 1 )----
+f[call:1; len:7]1234567
+f[call:2; len:1]8
+
+----( chunk_size: 8, output append size: 1 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 9, output append size: 1 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: -1, output append size: 4 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 0, output append size: 4 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 1, output append size: 4 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 2, output append size: 4 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 3, output append size: 4 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 4, output append size: 4 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 5, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 6, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 7, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 8, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 9, output append size: 4 )----
+f[call:1; len:8]12345678
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_end_clean_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_end_clean_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_end_clean_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_end_clean_basic_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,31 @@
+--TEST--
+Test return type and value, as well as basic behaviour, for ob_end_clean()
+--FILE--
+<?php
+/* 
+ * proto bool ob_end_clean(void)
+ * Function is implemented in main/output.c
+*/ 
+
+var_dump(ob_end_clean());
+
+ob_start();
+var_dump(ob_end_clean());
+
+ob_start();
+echo "Hello";
+var_dump(ob_end_clean());
+
+var_dump(ob_end_clean());
+
+?>
+--EXPECTF--
+
+Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in %s on 
line 7
+bool(false)
+bool(true)
+bool(true)
+
+Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in %s on 
line 16
+bool(false)
+
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_flush_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_flush_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_flush_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_flush_basic_001.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,39 @@
+--TEST--
+Test ob_flush() function : basic functionality 
+--FILE--
+<?php
+/* Prototype  : proto bool ob_flush(void)
+ * Description: Flush (send) contents of the output buffer. The last buffer 
content is sent to next buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_flush() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_flush() function with Zero arguments --\n";
+var_dump(ob_flush());
+
+ob_start();
+echo "This should get flushed.\n";
+var_dump(ob_flush());
+
+echo "Ensure the buffer is still active after the flush.\n";
+$out = ob_flush();
+var_dump($out);
+
+echo "Done";
+
+?>
+--EXPECTF--
+*** Testing ob_flush() : basic functionality ***
+
+-- Testing ob_flush() function with Zero arguments --
+
+Notice: ob_flush(): failed to flush buffer. No buffer to flush in %s on line 12
+bool(false)
+This should get flushed.
+bool(true)
+Ensure the buffer is still active after the flush.
+bool(true)
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_002.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_002.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_002.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,57 @@
+--TEST--
+ob_start(): Check behaviour with various callback return values.
+--XFAIL--
+PHP6 behaves differently from PHP5 when callback returns null. See bug 46900.
+--FILE--
+<?php
+function return_empty_string($string) {
+       return "";
+}
+
+function return_false($string) {
+       return false;
+}
+
+function return_null($string) {
+       return null;
+}
+
+function return_string($string) {
+       return "I stole your output.";
+}
+
+function return_zero($string) {
+       return 0;
+}
+
+// Use each of the above functions as an output buffering callback:
+$functions = get_defined_functions();
+$callbacks = $functions['user'];
+sort($callbacks);
+foreach ($callbacks as $callback) {
+  echo "--> Use callback '$callback':\n";
+  ob_start($callback);
+  echo 'My output.';
+  ob_end_flush();
+  echo "\n\n";
+}
+
+?>
+==DONE==
+--EXPECTF--
+--> Use callback 'return_empty_string':
+
+
+--> Use callback 'return_false':
+My output.
+
+--> Use callback 'return_null':
+
+
+--> Use callback 'return_string':
+I stole your output.
+
+--> Use callback 'return_zero':
+0
+
+==DONE==
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_clean_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_clean_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_clean_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_clean_error_001.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_clean() function : error conditions 
+--FILE--
+<?php
+/* Prototype  : proto bool ob_clean(void)
+ * Description: Clean (delete) the current output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_clean() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_clean() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_clean($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_clean() : error conditions ***
+
+-- Testing ob_clean() function with one argument --
+
+Warning: ob_clean() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_implicit_flush_basic_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_implicit_flush_basic_002.phpt
diff -u /dev/null php-src/tests/output/ob_implicit_flush_basic_002.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_implicit_flush_basic_002.phpt       Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,29 @@
+--TEST--
+Test ob_implicit_flush() function : ensure implicit flushing does not apply to 
user buffers.
+--FILE--
+<?php
+/* Prototype  : proto void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling 
flush() after every output call 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_implicit_flush() : ensure implicit flushing does not 
apply to user buffers. ***\n";
+
+// Start a user buffer
+ob_start();
+// Switch on implicit flushing.
+ob_implicit_flush(1);
+
+echo "This is being written to a user buffer.\n";
+echo "Note that even though implicit flushing is on, you should never see 
this,\n";
+echo "because implicit flushing affects only the top level buffer, not user 
buffers.\n";
+
+// Wipe the user buffer. Nothing should have been flushed.
+ob_end_clean();
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : ensure implicit flushing does not apply to 
user buffers. ***
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_clean_basic_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_clean_basic_002.phpt
diff -u /dev/null php-src/tests/output/ob_get_clean_basic_002.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_clean_basic_002.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,20 @@
+--TEST--
+Test basic behaviour of ob_get_clean()
+--FILE--
+<?php
+/* 
+ * proto bool ob_get_clean(void)
+ * Function is implemented in main/output.c
+*/ 
+
+ob_start();
+
+echo "Hello World";
+
+$out = ob_get_clean();
+$out = strtolower($out);
+
+var_dump($out);
+?>
+--EXPECT--
+string(11) "hello world"
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_error_005.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_error_005.phpt
diff -u /dev/null php-src/tests/output/ob_start_error_005.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_error_005.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,23 @@
+--TEST--
+ob_start(): ensure buffers can't be added from within callback.
+--FILE--
+<?php
+
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+function f($str) {
+       ob_start();
+       echo "hello";
+       ob_end_flush();
+       return $str;
+}
+
+
+var_dump(ob_start('f'));
+echo "done";
+?>
+--EXPECTF--
+Fatal error: ob_start(): Cannot use output buffering in output buffering 
display handlers in %s on line 9
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_error_003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_error_003.phpt
diff -u /dev/null php-src/tests/output/ob_start_error_003.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_error_003.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,20 @@
+--TEST--
+Test ob_start() with object supplied but no method.
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+Class C {
+}
+
+$c = new C;
+var_dump(ob_start(array($c)));
+echo "done"
+?>
+--EXPECTF--
+Notice: ob_start(): failed to create buffer in %s on line 11
+bool(false)
+done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_start_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_error_001.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,51 @@
+--TEST--
+Test wrong number of arguments and wrong arg types for ob_start()
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+function justPrint($str) {
+       return $str;
+}
+
+$arg_1 = "justPrint";
+$arg_2 = 0;
+$arg_3 = false;
+$extra_arg = 1;
+
+echo "\n- Too many arguments\n";
+var_dump(ob_start($arg_1, $arg_2, $arg_3, $extra_arg));
+
+echo "\n- Arg 1 wrong type\n";
+var_dump(ob_start(1.5));
+
+echo "\n- Arg 2 wrong type\n";
+var_dump(ob_start("justPrint", "this should be an int"));
+
+echo "\n- Arg 3 wrong type\n";
+var_dump(ob_start("justPrint", 0, "this should be a bool"));
+
+?>
+--EXPECTF--
+- Too many arguments
+
+Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17
+bool(false)
+
+- Arg 1 wrong type
+
+Notice: ob_start(): failed to create buffer in %s on line 20
+bool(false)
+
+- Arg 2 wrong type
+
+Warning: ob_start() expects parameter 2 to be long, Unicode string given in %s 
on line 23
+bool(false)
+
+- Arg 3 wrong type
+
+Warning: ob_start() expects parameter 3 to be long, Unicode string given in %s 
on line 26
+bool(false)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_implicit_flush_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_implicit_flush_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_implicit_flush_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_implicit_flush_error_001.phpt       Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,29 @@
+--TEST--
+Test ob_implicit_flush() function : wrong number of arguments
+--FILE--
+<?php
+/* Prototype  : proto void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling 
flush() after every output call 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_implicit_flush() : error conditions ***\n";
+
+
+//Test ob_implicit_flush with one more than the expected number of arguments
+echo "\n-- Testing ob_implicit_flush() function with more than expected no. of 
arguments --\n";
+$flag = 10;
+$extra_arg = 10;
+var_dump( ob_implicit_flush($flag, $extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : error conditions ***
+
+-- Testing ob_implicit_flush() function with more than expected no. of 
arguments --
+
+Warning: ob_implicit_flush() expects at most 1 parameter, 2 given in %s on 
line 15
+NULL
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_contents_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_contents_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_contents_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_contents_basic_001.phpt Thu Dec 18 15:20:10 2008
@@ -0,0 +1,73 @@
+--TEST--
+Test ob_get_contents() function : basic functionality
+--CREDITS--
+Iain Lewis <ile...@php.net> 
+--FILE--
+<?php
+/* Prototype  : proto string ob_get_contents(void)
+ * Description: Return the contents of the output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+
+echo "*** Testing ob_get_contents() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_get_contents() function with Zero arguments --\n";
+/* Buffering not started yet, should return false */
+var_dump( ob_get_contents() );
+
+ob_start();
+echo "Hello World\n";
+$hello = ob_get_contents();
+var_dump($hello);
+ob_end_flush();
+
+
+echo "\ncheck that we dont have a reference\n";
+ob_start();
+echo "Hello World\n";
+$hello2 = ob_get_contents();
+$hello2 = "bob";
+var_dump(ob_get_contents());
+ob_end_flush();
+
+echo "\ncheck that contents disappear after a flush\n";
+ob_start();
+echo "Hello World\n"; 
+ob_flush();
+var_dump(ob_get_contents());
+ob_end_flush();
+
+echo "\ncheck that no contents found after an end\n";
+ob_start();
+echo "Hello World\n"; 
+ob_end_flush();
+var_dump(ob_get_contents());
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+*** Testing ob_get_contents() : basic functionality ***
+
+-- Testing ob_get_contents() function with Zero arguments --
+bool(false)
+Hello World
+string(12) "Hello World
+"
+
+check that we dont have a reference
+Hello World
+string(12) "Hello World
+"
+
+check that contents disappear after a flush
+Hello World
+string(0) ""
+
+check that no contents found after an end
+Hello World
+bool(false)
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_level_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_level_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_level_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_level_basic_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,47 @@
+--TEST--
+Test ob_get_level() function : basic functionality 
+--FILE--
+<?php
+/* Prototype  : proto int ob_get_level(void)
+ * Description: Return the nesting level of the output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_get_level() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_get_level() function with Zero arguments --\n";
+var_dump(ob_get_level());
+
+ob_start();
+var_dump(ob_get_level());
+
+ob_start();
+var_dump(ob_get_level());
+
+ob_end_flush();
+var_dump(ob_get_level());
+
+ob_end_flush();
+var_dump(ob_get_level());
+
+ob_end_flush();
+var_dump(ob_get_level());
+
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_get_level() : basic functionality ***
+
+-- Testing ob_get_level() function with Zero arguments --
+int(0)
+int(1)
+int(2)
+int(1)
+int(0)
+
+Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete 
or flush in %s on line 26
+int(0)
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_end_flush_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_end_flush_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_end_flush_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_end_flush_error_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_end_flush() function : error conditions 
+--FILE--
+<?php
+/* Prototype  : proto bool ob_end_flush(void)
+ * Description: Flush (send) the output buffer, and delete current output 
buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_end_flush() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_end_flush() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_end_flush($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_end_flush() : error conditions ***
+
+-- Testing ob_end_flush() function with one argument --
+
+Warning: ob_end_flush() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_clean_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_clean_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_clean_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_clean_error_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,22 @@
+--TEST--
+Test wrong number of arguments for ob_get_clean()
+--FILE--
+<?php
+/* 
+ * proto bool ob_get_clean(void)
+ * Function is implemented in main/output.c
+*/ 
+
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(ob_get_clean($extra_arg));
+
+
+?>
+--EXPECTF--
+
+Too many arguments
+
+Warning: ob_get_clean() expects exactly 0 parameters, 1 given in %s on line 10
+NULL
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_unerasable_005.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_unerasable_005.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_unerasable_005.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_unerasable_005.phpt     Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,25 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be flushed by ob_flush().
+--FILE--
+<?php
+function callback($string) {
+       static $callback_invocations;
+       $callback_invocations++;
+       return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "Attempt to flush unerasable buffer - should fail... ";
+var_dump(ob_flush());
+// Check content of buffer after flush - if flush failed it should still 
contain the string above.
+var_dump(ob_get_contents());
+?>
+--EXPECTF--
+[callback:1]Attempt to flush unerasable buffer - should fail... 
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11
+bool(false)
+string(%d) "Attempt to flush unerasable buffer - should fail... 
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11
+bool(false)
+"
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_unerasable_003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_unerasable_003.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_unerasable_003.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_unerasable_003.phpt     Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,22 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be accessed or erased by 
ob_get_clean().
+--FILE--
+<?php
+function callback($string) {
+       static $callback_invocations;
+       $callback_invocations++;
+       return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "This call will obtain the content, but will not clean the buffer.";
+$str = ob_get_clean();
+var_dump($str);
+?>
+--EXPECTF--
+[callback:1]This call will obtain the content, but will not clean the buffer.
+Notice: ob_get_clean(): failed to discard buffer of callback (0) in %s on line 
11
+
+Notice: ob_get_clean(): failed to delete buffer of callback (0) in %s on line 
11
+string(65) "This call will obtain the content, but will not clean the buffer."
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/flush_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/flush_error_001.phpt
diff -u /dev/null php-src/tests/output/flush_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/flush_error_001.phpt   Thu Dec 18 15:20:10 2008
@@ -0,0 +1,16 @@
+--TEST--
+Test wrong number of arguments for flush() (no impact)
+--FILE--
+<?php
+/* 
+ * proto void flush(void)
+ * Function is implemented in ext/standard/basic_functions.c.
+ */
+
+$extra_arg = 1;
+echo "\nToo many arguments\n";
+var_dump(flush($extra_arg));
+?>
+--EXPECTF--
+Too many arguments
+NULL
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_unerasable_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_unerasable_001.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_unerasable_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_unerasable_001.phpt     Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,22 @@
+--TEST--
+ob_start(): Ensure content of unerasable buffer can be accessed by 
ob_get_contents().
+--FILE--
+<?php
+function callback($string) {
+       static $callback_invocations;
+       $callback_invocations++;
+       return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "This call will obtain the content:\n";
+$str = ob_get_contents();
+var_dump($str);
+?>
+==DONE==
+--EXPECTF--
+[callback:1]This call will obtain the content:
+string(35) "This call will obtain the content:
+"
+==DONE==
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_clean_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_clean_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_clean_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_clean_basic_001.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,36 @@
+--TEST--
+Test ob_clean() function : basic functionality 
+--FILE--
+<?php
+/* Prototype  : proto bool ob_clean(void)
+ * Description: Clean (delete) the current output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_clean() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_clean() function with Zero arguments --\n";
+var_dump( ob_clean() );
+
+ob_start();
+echo "You should never see this.";
+var_dump(ob_clean());
+
+echo "Ensure the buffer is still active after the clean.";
+$out = ob_get_clean();
+var_dump($out);
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_clean() : basic functionality ***
+
+-- Testing ob_clean() function with Zero arguments --
+
+Notice: ob_clean(): failed to delete buffer. No buffer to delete in %s on line 
12
+bool(false)
+string(61) "bool(true)
+Ensure the buffer is still active after the clean."
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_implicit_flush_variation_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_implicit_flush_variation_001.phpt
diff -u /dev/null php-src/tests/output/ob_implicit_flush_variation_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_implicit_flush_variation_001.phpt   Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,192 @@
+--TEST--
+Test ob_implicit_flush() function : usage variation 
+--FILE--
+<?php
+/* Prototype  : void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling 
flush() after every output call 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_implicit_flush() : usage variation ***\n";
+
+// Define error handler
+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
+       if (error_reporting() != 0) {
+               // report non-silenced errors
+               echo "Error: $err_no - $err_msg, $filename($linenum)\n";
+       }
+}
+set_error_handler('test_error_handler');
+
+// Initialise function arguments not being substituted (if any)
+
+//get an unset variable
+$unset_var = 10;
+unset ($unset_var);
+
+// define some classes
+class classWithToString
+{
+       public function __toString() {
+               return "Class A object";
+       }
+}
+
+class classWithoutToString
+{
+}
+
+// heredoc string
+$heredoc = <<<EOT
+hello world
+EOT;
+
+// add arrays
+$index_array = array (1, 2, 3);
+$assoc_array = array ('one' => 1, 'two' => 2);
+
+//array of values to iterate over
+$inputs = array(
+
+      // float data
+      'float 10.5' => 10.5,
+      'float -10.5' => -10.5,
+      'float 12.3456789000e10' => 12.3456789000e10,
+      'float -12.3456789000e10' => -12.3456789000e10,
+      'float .5' => .5,
+
+      // array data
+      'empty array' => array(),
+      'int indexed array' => $index_array,
+      'associative array' => $assoc_array,
+      'nested arrays' => array('foo', $index_array, $assoc_array),
+
+      // null data
+      'uppercase NULL' => NULL,
+      'lowercase null' => null,
+
+      // boolean data
+      'lowercase true' => true,
+      'lowercase false' =>false,
+      'uppercase TRUE' =>TRUE,
+      'uppercase FALSE' =>FALSE,
+
+      // empty data
+      'empty string DQ' => "",
+      'empty string SQ' => '',
+
+      // string data
+      'string DQ' => "string",
+      'string SQ' => 'string',
+      'mixed case string' => "sTrInG",
+      'heredoc' => $heredoc,
+
+      // object data
+      'instance of classWithToString' => new classWithToString(),
+      'instance of classWithoutToString' => new classWithoutToString(),
+
+      // undefined data
+      'undefined var' => @$undefined_var,
+
+      // unset data
+      'unset var' => @$unset_var,
+);
+
+// loop through each element of the array for flag
+
+foreach($inputs as $key =>$value) {
+      echo "\n--$key--\n";
+      var_dump( ob_implicit_flush($value) );
+};
+
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : usage variation ***
+
+--float 10.5--
+NULL
+
+--float -10.5--
+NULL
+
+--float 12.3456789000e10--
+NULL
+
+--float -12.3456789000e10--
+NULL
+
+--float .5--
+NULL
+
+--empty array--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, 
%s(97)
+NULL
+
+--int indexed array--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, 
%s(97)
+NULL
+
+--associative array--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, 
%s(97)
+NULL
+
+--nested arrays--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, 
%s(97)
+NULL
+
+--uppercase NULL--
+NULL
+
+--lowercase null--
+NULL
+
+--lowercase true--
+NULL
+
+--lowercase false--
+NULL
+
+--uppercase TRUE--
+NULL
+
+--uppercase FALSE--
+NULL
+
+--empty string DQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, 
%unicode_string_optional% given, %s(97)
+NULL
+
+--empty string SQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, 
%unicode_string_optional% given, %s(97)
+NULL
+
+--string DQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, 
%unicode_string_optional% given, %s(97)
+NULL
+
+--string SQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, 
%unicode_string_optional% given, %s(97)
+NULL
+
+--mixed case string--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, 
%unicode_string_optional% given, %s(97)
+NULL
+
+--heredoc--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, 
%unicode_string_optional% given, %s(97)
+NULL
+
+--instance of classWithToString--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, object given, 
%s(97)
+NULL
+
+--instance of classWithoutToString--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, object given, 
%s(97)
+NULL
+
+--undefined var--
+NULL
+
+--unset var--
+NULL
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_005.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_005.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_005.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_005.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,33 @@
+--TEST--
+ob_start(): non-static method as static callbacks.
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+Class C {
+       function h($string) {
+               return $string;
+       }
+}
+
+function checkAndClean() {
+  print_r(ob_list_handlers());
+  while (ob_get_level()>0) {
+    ob_end_flush();
+  }
+}
+
+var_dump(ob_start('C::h'));
+checkAndClean();
+
+?>
+--EXPECTF--
+Strict Standards: Non-static method C::h() should not be called statically in 
%s on line 20
+bool(true)
+Array
+(
+    [0] => C::h
+)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_003.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_003.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_003.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,18 @@
+--TEST--
+ob_start(): ensure even fatal error test is affected by output buffering.
+--FILE--
+<?php
+
+function f() {
+       return "I have stolen your output";
+}
+
+ob_start('f');
+cause_fatal_error(); // call undefined function
+ob_end_flush();
+
+echo "done (you shouldn't see this)";
+
+?>
+--EXPECTF--
+I have stolen your output
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_implicit_flush_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_implicit_flush_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_implicit_flush_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_implicit_flush_basic_001.phpt       Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,24 @@
+--TEST--
+Test ob_implicit_flush() function : check return value (always null).
+--FILE--
+<?php
+/* Prototype  : proto void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling 
flush() after every output call 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_implicit_flush() : check return value ***\n";
+
+var_dump(ob_implicit_flush());
+var_dump(ob_implicit_flush(true));
+var_dump(ob_implicit_flush(false));
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : check return value ***
+NULL
+NULL
+NULL
+Done
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_001.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,14 @@
+--TEST--
+Test return type and value for ob_start()
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+var_dump(ob_start());
+
+?>
+--EXPECT--
+bool(true)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_length_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_length_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_length_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_length_error_001.phpt   Thu Dec 18 15:20:10 2008
@@ -0,0 +1,22 @@
+--TEST--
+Test wrong number of arguments for ob_get_length()
+--FILE--
+<?php
+/* 
+ * proto int ob_get_length(void)
+ * Function is implemented in main/output.c
+*/ 
+
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(ob_get_length($extra_arg));
+
+
+?>
+--EXPECTF--
+
+Too many arguments
+
+Warning: ob_get_length() expects exactly 0 parameters, 1 given in %s on line 10
+NULL
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_clean_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_clean_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_clean_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_clean_basic_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,19 @@
+--TEST--
+Test return type and value, as well as basic behaviour, of ob_get_clean()
+--FILE--
+<?php
+/* 
+ * proto bool ob_get_clean(void)
+ * Function is implemented in main/output.c
+*/ 
+
+var_dump(ob_get_clean());
+
+ob_start();
+echo "Hello World";
+var_dump(ob_get_clean());
+?>
+--EXPECTF--
+Notice: ob_get_clean(): failed to delete buffer. No buffer to delete in %s on 
line 7
+bool(false)
+string(11) "Hello World"
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_end_flush_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_end_flush_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_end_flush_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_end_flush_basic_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,41 @@
+--TEST--
+Test ob_end_flush() function : basic functionality 
+--FILE--
+<?php
+/* Prototype  : proto bool ob_end_flush(void)
+ * Description: Flush (send) the output buffer, and delete current output 
buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_end_flush() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_end_flush() function with Zero arguments --\n";
+var_dump(ob_end_flush());
+
+ob_start();
+var_dump(ob_end_flush());
+
+ob_start();
+echo "Hello\n";
+var_dump(ob_end_flush());
+
+var_dump(ob_end_flush());
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_end_flush() : basic functionality ***
+
+-- Testing ob_end_flush() function with Zero arguments --
+
+Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete 
or flush in %s on line 12
+bool(false)
+bool(true)
+Hello
+bool(true)
+
+Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete 
or flush in %s on line 21
+bool(false)
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_error_004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_error_004.phpt
diff -u /dev/null php-src/tests/output/ob_start_error_004.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_error_004.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,20 @@
+--TEST--
+Test ob_start() with non existent callback method.
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+Class C {
+}
+
+$c = new C;
+var_dump(ob_start(array($c, 'f')));
+echo "done"
+?>
+--EXPECTF--
+Notice: ob_start(): failed to create buffer in %s on line 11
+bool(false)
+done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_end_clean_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_end_clean_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_end_clean_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_end_clean_error_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,22 @@
+--TEST--
+Test wrong number of arguments for ob_end_clean()
+--FILE--
+<?php
+/* 
+ * proto bool ob_end_clean(void)
+ * Function is implemented in main/output.c
+*/ 
+
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(ob_end_clean($extra_arg));
+
+
+?>
+--EXPECTF--
+
+Too many arguments
+
+Warning: ob_end_clean() expects exactly 0 parameters, 1 given in %s on line 10
+NULL
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_flush_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_flush_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_flush_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_flush_error_001.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_flush() function : error conditions 
+--FILE--
+<?php
+/* Prototype  : proto bool ob_flush(void)
+ * Description: Flush (send) contents of the output buffer. The last buffer 
content is sent to next buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_flush() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_flush() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_flush($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_flush() : error conditions ***
+
+-- Testing ob_flush() function with one argument --
+
+Warning: ob_flush() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_error_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_error_002.phpt
diff -u /dev/null php-src/tests/output/ob_start_error_002.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_error_002.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,34 @@
+--TEST--
+Test wrong number of arguments and wrong arg types for ob_start()
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+Class C {
+       static function f($str) {
+               return $str;
+       }
+}
+
+var_dump(ob_start(array("nonExistent","f")));
+var_dump(ob_start(array("C","nonExistent")));
+var_dump(ob_start("C::no"));
+var_dump(ob_start("no"));
+echo "done"
+?>
+--EXPECTF--
+Notice: ob_start(): failed to create buffer in %s on line 13
+bool(false)
+
+Notice: ob_start(): failed to create buffer in %s on line 14
+bool(false)
+
+Notice: ob_start(): failed to create buffer in %s on line 15
+bool(false)
+
+Notice: ob_start(): failed to create buffer in %s on line 16
+bool(false)
+done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_contents_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_contents_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_contents_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_contents_error_001.phpt Thu Dec 18 15:20:10 2008
@@ -0,0 +1,32 @@
+--TEST--
+Test ob_get_contents() function : error cases
+--CREDITS--
+Iain Lewis <ile...@php.net> 
+--FILE--
+<?php
+/* Prototype  : proto string ob_get_contents(void)
+ * Description: Return the contents of the output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+
+echo "*** Testing ob_get_contents() : error cases ***\n";
+
+var_dump(ob_get_contents("bob"));
+
+ob_start();
+
+var_dump(ob_get_contents("bob2",345));
+
+echo "Done\n";
+?>
+--EXPECTF--
+*** Testing ob_get_contents() : error cases ***
+
+Warning: ob_get_contents() expects exactly 0 parameters, 1 given in %s on line 
11
+NULL
+
+Warning: ob_get_contents() expects exactly 0 parameters, 2 given in %s on line 
15
+NULL
+Done
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_level_error_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_level_error_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_level_error_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_level_error_001.phpt    Thu Dec 18 15:20:10 2008
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_get_level() function : error conditions 
+--FILE--
+<?php
+/* Prototype  : proto int ob_get_level(void)
+ * Description: Return the nesting level of the output buffer 
+ * Source code: main/output.c
+ * Alias to functions: 
+ */
+
+echo "*** Testing ob_get_level() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_get_level() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_get_level($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_get_level() : error conditions ***
+
+-- Testing ob_get_level() function with one argument --
+
+Warning: ob_get_level() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/flush_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/flush_basic_001.phpt
diff -u /dev/null php-src/tests/output/flush_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/flush_basic_001.phpt   Thu Dec 18 15:20:10 2008
@@ -0,0 +1,26 @@
+--TEST--
+Test basic functionality of flush()
+--FILE--
+<?php
+/* 
+ * proto void flush(void)
+ * Function is implemented in ext/standard/basic_functions.c.
+ */
+  
+// Verify return type
+var_dump(flush());
+
+// Ensure user buffers are not flushed by flush()
+ob_start();
+echo "Inside a user buffer\n";
+flush();
+ob_end_clean();
+
+echo "Outside of any user buffers\n";
+var_dump(flush());
+
+?>
+--EXPECT--
+NULL
+Outside of any user buffers
+NULL
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_unerasable_004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_unerasable_004.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_unerasable_004.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_unerasable_004.phpt     Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,22 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be accessed or flushed by 
ob_get_flush().
+--FILE--
+<?php
+function callback($string) {
+       static $callback_invocations;
+       $callback_invocations++;
+       return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "This call will obtain the content, but will not flush the buffer.";
+$str = ob_get_flush();
+var_dump($str);
+?>
+--EXPECTF--
+[callback:1]This call will obtain the content, but will not flush the buffer.
+Notice: ob_get_flush(): failed to send buffer of callback (0) in %s on line 11
+
+Notice: ob_get_flush(): failed to delete buffer of callback (0) in %s on line 
11
+string(65) "This call will obtain the content, but will not flush the buffer."
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_unerasable_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_unerasable_002.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_unerasable_002.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_unerasable_002.phpt     Thu Dec 18 
15:20:10 2008
@@ -0,0 +1,33 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be erased by ob_clean(), 
ob_end_clean() or ob_end_flush().
+--FILE--
+<?php
+function callback($string) {
+       static $callback_invocations;
+       $callback_invocations++;
+       return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "All of the following calls will fail to clean/remove the topmost 
buffer:\n";
+var_dump(ob_clean());
+var_dump(ob_end_clean());
+var_dump(ob_end_flush());
+
+echo "The OB nesting will still be 1 level deep:\n";
+var_dump(ob_get_level());
+?>
+--EXPECTF--
+[callback:1]All of the following calls will fail to clean/remove the topmost 
buffer:
+
+Notice: ob_clean(): failed to delete buffer of callback (0) in %s on line 11
+bool(false)
+
+Notice: ob_end_clean(): failed to discard buffer of callback (0) in %s on line 
12
+bool(false)
+
+Notice: ob_end_flush(): failed to send buffer of callback (0) in %s on line 13
+bool(false)
+The OB nesting will still be 1 level deep:
+int(1)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_start_basic_006.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_start_basic_006.phpt
diff -u /dev/null php-src/tests/output/ob_start_basic_006.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_start_basic_006.phpt        Thu Dec 18 15:20:10 2008
@@ -0,0 +1,123 @@
+--TEST--
+ob_start(): ensure multiple buffer initialization with a single call using 
arrays is not supported on PHP6 (http://bugs.php.net/42641)
+--FILE--
+<?php
+/* 
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool 
erase]]])
+ * Function is implemented in main/output.c
+*/ 
+
+function f($string) {
+       static $i=0;
+       $i++;
+       $len = strlen($string);
+       return "f[call:$i; len:$len] - $string\n";
+}
+
+Class C {
+       public $id = 'none';
+
+       function __construct($id) {
+               $this->id = $id;
+       }
+
+       static function g($string) {
+               static $i=0;
+               $i++;
+               $len = strlen($string);
+               return "C::g[call:$i; len:$len] - $string\n";
+       }
+       
+       function h($string) {
+               static $i=0;
+               $i++;
+               $len = strlen($string);
+               return "C::h[call:$i; len:$len; id:$this->id] - $string\n";
+       }
+}
+
+function checkAndClean() {
+  print_r(ob_list_handlers());
+  while (ob_get_level()>0) {
+    ob_end_flush();
+  }
+}
+
+echo "\n ---> Test arrays: \n";
+var_dump(ob_start(array("f")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "f")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "C::g", "f", "C::g")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "non_existent", "f")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "non_existent", "f", "f")));
+checkAndClean();
+
+$c = new c('originalID');
+var_dump(ob_start(array($c, "h")));
+checkAndClean();
+
+var_dump(ob_start(array($c, "h")));
+$c->id = 'changedID';
+checkAndClean();
+
+$c->id = 'changedIDagain';
+var_dump(ob_start(array('f', 'C::g', array(array($c, "g"), array($c, "h")))));
+checkAndClean();
+?>
+--EXPECTF---
+ ---> Test arrays: 
+
+Notice: ob_start(): failed to create buffer in %s on line 44
+bool(false)
+Array
+(
+)
+
+Notice: ob_start(): failed to create buffer in %s on line 47
+bool(false)
+Array
+(
+)
+
+Notice: ob_start(): failed to create buffer in %s on line 50
+bool(false)
+Array
+(
+)
+
+Notice: ob_start(): failed to create buffer in %s on line 53
+bool(false)
+Array
+(
+)
+
+Notice: ob_start(): failed to create buffer in %s on line 56
+bool(false)
+Array
+(
+)
+C::h[call:1; len:37; id:originalID] - bool(true)
+Array
+(
+    [0] => C::h
+)
+
+C::h[call:2; len:37; id:changedID] - bool(true)
+Array
+(
+    [0] => C::h
+)
+
+
+Notice: ob_start(): failed to create buffer in %s on line 68
+bool(false)
+Array
+(
+)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_get_length_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/output/ob_get_length_basic_001.phpt
diff -u /dev/null php-src/tests/output/ob_get_length_basic_001.phpt:1.2
--- /dev/null   Thu Dec 18 15:20:10 2008
+++ php-src/tests/output/ob_get_length_basic_001.phpt   Thu Dec 18 15:20:10 2008
@@ -0,0 +1,37 @@
+--TEST--
+Test return type and value, as well as basic behaviour, of ob_get_length()
+--FILE--
+<?php
+/* 
+ * proto int ob_get_length(void)
+ * Function is implemented in main/output.c
+*/ 
+
+echo "No output buffers\n";
+var_dump(ob_get_length());
+
+ob_start();
+var_dump(ob_get_length());
+echo "hello\n";
+var_dump(ob_get_length());
+ob_flush();
+$value = ob_get_length();
+echo "hello\n";
+ob_clean();
+var_dump(ob_get_length());
+var_dump($value);
+ob_end_flush();
+
+echo "No output buffers\n";
+var_dump(ob_get_length());
+?>
+--EXPECTF--
+No output buffers
+bool(false)
+int(0)
+hello
+int(13)
+int(0)
+int(0)
+No output buffers
+bool(false)
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to