summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2010-05-31 10:29:43 (GMT)
committerMichael Wallner <mike@php.net>2010-05-31 10:29:43 (GMT)
commit11d24c1593d6617f73d3f290617bd8994182f4dc (patch)
treeeddeffa97ad3893b731144afb003e26ef0952de9 /tests
parent27299b7e4084adb236acfbfb25168d72306ee802 (diff)
downloadphp-11d24c1593d6617f73d3f290617bd8994182f4dc.tar.gz
* implement new output API, fixing some bugs and implementing some feature
requests--let's see what I can dig out of the bugtracker for NEWS-- and while crossing the road: * implemented new zlib API * fixed up ext/tidy (what was "s&" in zend_parse_parameters() supposed to do?) Thanks to Jani and Felipe for pioneering.
Diffstat (limited to 'tests')
-rw-r--r--tests/output/bug46897.phpt4
-rw-r--r--tests/output/ob_011.phpt2
-rw-r--r--tests/output/ob_013.phpt72
-rw-r--r--tests/output/ob_017.phpt12
-rw-r--r--tests/output/ob_clean_basic_001.phpt4
-rw-r--r--tests/output/ob_end_clean_basic_001.phpt4
-rw-r--r--tests/output/ob_end_flush_basic_001.phpt6
-rw-r--r--tests/output/ob_flush_basic_001.phpt4
-rw-r--r--tests/output/ob_get_clean_basic_001.phpt1
-rw-r--r--tests/output/ob_get_level_basic_001.phpt4
-rw-r--r--tests/output/ob_get_status.phpt23
-rw-r--r--tests/output/ob_start_basic_004.phpt18
-rw-r--r--tests/output/ob_start_basic_006.phpt43
-rw-r--r--tests/output/ob_start_basic_unerasable_002.phpt6
-rw-r--r--tests/output/ob_start_basic_unerasable_003.phpt9
-rw-r--r--tests/output/ob_start_basic_unerasable_004.phpt9
-rw-r--r--tests/output/ob_start_basic_unerasable_005.phpt4
-rw-r--r--tests/output/ob_start_error_001.phpt13
-rw-r--r--tests/output/ob_start_error_002.phpt7
-rw-r--r--tests/output/ob_start_error_003.phpt4
-rw-r--r--tests/output/ob_start_error_004.phpt4
21 files changed, 134 insertions, 119 deletions
diff --git a/tests/output/bug46897.phpt b/tests/output/bug46897.phpt
index 6cfb102..8fe80bc 100644
--- a/tests/output/bug46897.phpt
+++ b/tests/output/bug46897.phpt
@@ -18,10 +18,10 @@ echo 'Done';
?>
--EXPECTF--
[callback:1]Attempt to flush unerasable buffer - should fail...
-Notice: ob_flush(): failed to flush buffer callback. in %s on line %d
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d
bool(false)
string(%d) "Attempt to flush unerasable buffer - should fail...
-Notice: ob_flush(): failed to flush buffer callback. in %s on line %d
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d
bool(false)
"
Done
diff --git a/tests/output/ob_011.phpt b/tests/output/ob_011.phpt
index a90fd56..35b0388 100644
--- a/tests/output/ob_011.phpt
+++ b/tests/output/ob_011.phpt
@@ -1,7 +1,5 @@
--TEST--
output buffering - fatalism
---XFAIL--
-This test will fail until the fix in revision r214155 is backported from php 6
--FILE--
<?php
function obh($s)
diff --git a/tests/output/ob_013.phpt b/tests/output/ob_013.phpt
index ce5b5e5..e96de46 100644
--- a/tests/output/ob_013.phpt
+++ b/tests/output/ob_013.phpt
@@ -37,67 +37,69 @@ Array
)
Array
(
- [level] => 5
- [type] => 1
- [status] => 1
[name] => d
- [del] => 1
+ [type] => 1
+ [flags] => 4209
+ [level] => 4
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 96
)
Array
(
[0] => Array
(
- [chunk_size] => 0
- [size] => 40960
- [block_size] => 10240
- [type] => 1
- [status] => 0
[name] => default output handler
- [del] => 1
+ [type] => 0
+ [flags] => 112
+ [level] => 0
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 0
)
[1] => Array
(
- [chunk_size] => 0
- [size] => 40960
- [block_size] => 10240
- [type] => 1
- [status] => 0
[name] => a
- [del] => 1
+ [type] => 1
+ [flags] => 113
+ [level] => 1
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 0
)
[2] => Array
(
- [chunk_size] => 0
- [size] => 40960
- [block_size] => 10240
- [type] => 1
- [status] => 0
[name] => b
- [del] => 1
+ [type] => 1
+ [flags] => 113
+ [level] => 2
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 0
)
[3] => Array
(
- [chunk_size] => 0
- [size] => 40960
- [block_size] => 10240
- [type] => 1
- [status] => 0
[name] => c
- [del] => 1
+ [type] => 1
+ [flags] => 113
+ [level] => 3
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 4
)
[4] => Array
(
- [chunk_size] => 0
- [size] => 40960
- [block_size] => 10240
- [type] => 1
- [status] => 1
[name] => d
- [del] => 1
+ [type] => 1
+ [flags] => 4209
+ [level] => 4
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => %d
)
-) \ No newline at end of file
+)
diff --git a/tests/output/ob_017.phpt b/tests/output/ob_017.phpt
index fc50e2f..070df60 100644
--- a/tests/output/ob_017.phpt
+++ b/tests/output/ob_017.phpt
@@ -24,11 +24,11 @@ yes!
yes!
Array
(
- [0] => 3: yes
- [1] => 2: !
+ [0] => 1: yes
+ [1] => 4: !
- [2] => 2: no
- [3] => 2: yes!
+ [2] => 2:
+ [3] => 0: yes!
- [4] => 4: no
-) \ No newline at end of file
+ [4] => 10:
+)
diff --git a/tests/output/ob_clean_basic_001.phpt b/tests/output/ob_clean_basic_001.phpt
index c93bea3..afaa7e2 100644
--- a/tests/output/ob_clean_basic_001.phpt
+++ b/tests/output/ob_clean_basic_001.phpt
@@ -29,8 +29,8 @@ echo "Done";
-- Testing ob_clean() function with Zero arguments --
-Notice: ob_clean(): failed to delete buffer. No buffer to delete. in %s on line 12
+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
+Done
diff --git a/tests/output/ob_end_clean_basic_001.phpt b/tests/output/ob_end_clean_basic_001.phpt
index 0b694e3..54e840b 100644
--- a/tests/output/ob_end_clean_basic_001.phpt
+++ b/tests/output/ob_end_clean_basic_001.phpt
@@ -21,11 +21,11 @@ var_dump(ob_end_clean());
?>
--EXPECTF--
-Notice: ob_end_clean(): failed to delete buffer. No buffer to delete. in %s on line 7
+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
+Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in %s on line 16
bool(false)
diff --git a/tests/output/ob_end_flush_basic_001.phpt b/tests/output/ob_end_flush_basic_001.phpt
index 7515fac..cba7802 100644
--- a/tests/output/ob_end_flush_basic_001.phpt
+++ b/tests/output/ob_end_flush_basic_001.phpt
@@ -30,12 +30,12 @@ echo "Done";
-- 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
+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
+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
+Done
diff --git a/tests/output/ob_flush_basic_001.phpt b/tests/output/ob_flush_basic_001.phpt
index 91fb695..57de5e3 100644
--- a/tests/output/ob_flush_basic_001.phpt
+++ b/tests/output/ob_flush_basic_001.phpt
@@ -30,10 +30,10 @@ echo "Done";
-- Testing ob_flush() function with Zero arguments --
-Notice: ob_flush(): failed to flush buffer. No buffer to flush. in %s on line 12
+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
+Done
diff --git a/tests/output/ob_get_clean_basic_001.phpt b/tests/output/ob_get_clean_basic_001.phpt
index 07673df..b57ddab 100644
--- a/tests/output/ob_get_clean_basic_001.phpt
+++ b/tests/output/ob_get_clean_basic_001.phpt
@@ -14,5 +14,6 @@ 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
diff --git a/tests/output/ob_get_level_basic_001.phpt b/tests/output/ob_get_level_basic_001.phpt
index 78217e4..65f3291 100644
--- a/tests/output/ob_get_level_basic_001.phpt
+++ b/tests/output/ob_get_level_basic_001.phpt
@@ -42,6 +42,6 @@ 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
+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
+Done
diff --git a/tests/output/ob_get_status.phpt b/tests/output/ob_get_status.phpt
index a6a3498..9580729 100644
--- a/tests/output/ob_get_status.phpt
+++ b/tests/output/ob_get_status.phpt
@@ -15,20 +15,19 @@ var_dump($status);
array(1) {
[0]=>
array(7) {
+ ["name"]=>
+ string(22) "default output handler"
+ ["type"]=>
+ int(0)
+ ["flags"]=>
+ int(112)
+ ["level"]=>
+ int(0)
["chunk_size"]=>
int(0)
- ["size"]=>
- int(40960)
- ["block_size"]=>
- int(10240)
- ["type"]=>
- int(1)
- ["status"]=>
+ ["buffer_size"]=>
+ int(16384)
+ ["buffer_used"]=>
int(0)
- ["name"]=>
- string(22) "default output handler"
- ["del"]=>
- bool(true)
}
}
-
diff --git a/tests/output/ob_start_basic_004.phpt b/tests/output/ob_start_basic_004.phpt
index 39d3aad..16f09e8 100644
--- a/tests/output/ob_start_basic_004.phpt
+++ b/tests/output/ob_start_basic_004.phpt
@@ -1,12 +1,12 @@
--TEST--
-ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size.
+ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size.
--FILE--
<?php
/*
* proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
-
+// In HEAD, $chunk_size value of 1 should not have any special behaviour (http://marc.info/?l=php-internals&m=123476465621346&w=2).
function callback($string) {
global $callback_invocations;
$callback_invocations++;
@@ -40,7 +40,15 @@ f[call:1; len:8]12345678
f[call:1; len:8]12345678
----( chunk_size: 1, output append size: 1 )----
-f[call:1; len:8]12345678
+f[call:1; len:1]1
+f[call:2; len:1]2
+f[call:3; len:1]3
+f[call:4; len:1]4
+f[call:5; len:1]5
+f[call:6; len:1]6
+f[call:7; len:1]7
+f[call:8; len:1]8
+f[call:9; len:0]
----( chunk_size: 2, output append size: 1 )----
f[call:1; len:2]12
@@ -85,7 +93,9 @@ f[call:1; len:8]12345678
f[call:1; len:8]12345678
----( chunk_size: 1, output append size: 4 )----
-f[call:1; len:8]12345678
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
----( chunk_size: 2, output append size: 4 )----
f[call:1; len:4]1234
diff --git a/tests/output/ob_start_basic_006.phpt b/tests/output/ob_start_basic_006.phpt
index e24ebd6..ff7a0cd 100644
--- a/tests/output/ob_start_basic_006.phpt
+++ b/tests/output/ob_start_basic_006.phpt
@@ -1,5 +1,5 @@
--TEST--
-ob_start(): multiple buffer initialization with a single call, using arrays.
+ob_start(): ensure multiple buffer initialization with a single call using arrays is not supported on PHP6 (http://bugs.php.net/42641)
--FILE--
<?php
/*
@@ -72,46 +72,37 @@ var_dump(ob_start(array('f', 'C::g', array(array($c, "g"), array($c, "h")))));
checkAndClean();
?>
--EXPECTF--
-
---> Test arrays:
-f[call:1; len:34] - bool(true)
+
+Notice: ob_start(): failed to create buffer in %s on line 44
+bool(false)
Array
(
- [0] => f
)
-f[call:3; len:68] - f[call:2; len:47] - bool(true)
+Notice: ob_start(): failed to create buffer in %s on line 47
+bool(false)
Array
(
- [0] => f
- [1] => f
)
-
-f[call:5; len:150] - C::g[call:2; len:125] - f[call:4; len:103] - C::g[call:1; len:79] - bool(true)
+Notice: ob_start(): failed to create buffer in %s on line 50
+bool(false)
Array
(
- [0] => f
- [1] => C::g
- [2] => f
- [3] => C::g
)
-
-
-
-f[call:6; len:35] - bool(false)
+Notice: ob_start(): failed to create buffer in %s on line 53
+bool(false)
Array
(
- [0] => f
)
-f[call:7; len:35] - bool(false)
+Notice: ob_start(): failed to create buffer in %s on line 56
+bool(false)
Array
(
- [0] => f
)
-
C::h[call:1; len:37; id:originalID] - bool(true)
Array
(
@@ -124,11 +115,9 @@ Array
[0] => C::h
)
-f[call:8; len:175] - C::g[call:4; len:150] - C::g[call:3; len:125] - C::h[call:3; len:82; id:changedIDagain] - bool(true)
+
+Notice: ob_start(): failed to create buffer in %s on line 68
+bool(false)
Array
(
- [0] => f
- [1] => C::g
- [2] => C::g
- [3] => C::h
-) \ No newline at end of file
+)
diff --git a/tests/output/ob_start_basic_unerasable_002.phpt b/tests/output/ob_start_basic_unerasable_002.phpt
index 2ffcbb9..21db1f3 100644
--- a/tests/output/ob_start_basic_unerasable_002.phpt
+++ b/tests/output/ob_start_basic_unerasable_002.phpt
@@ -21,13 +21,13 @@ 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 callback. in %s on line 11
+Notice: ob_clean(): failed to delete buffer of callback (0) in %s on line 11
bool(false)
-Notice: ob_end_clean(): failed to delete buffer callback. in %s on line 12
+Notice: ob_end_clean(): failed to discard buffer of callback (0) in %s on line 12
bool(false)
-Notice: ob_end_flush(): failed to delete buffer callback. in %s on line 13
+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
diff --git a/tests/output/ob_start_basic_unerasable_003.phpt b/tests/output/ob_start_basic_unerasable_003.phpt
index d201414..6eb6418 100644
--- a/tests/output/ob_start_basic_unerasable_003.phpt
+++ b/tests/output/ob_start_basic_unerasable_003.phpt
@@ -10,12 +10,13 @@ function callback($string) {
ob_start('callback', 0, false);
-echo "This call will fail to obtain the content, since it is also requesting a clean:\n";
+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 fail to obtain the content, since it is also requesting a clean:
+[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 callback. in %s on line 11
-bool(false) \ No newline at end of file
+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
diff --git a/tests/output/ob_start_basic_unerasable_004.phpt b/tests/output/ob_start_basic_unerasable_004.phpt
index 6669856..62d9756 100644
--- a/tests/output/ob_start_basic_unerasable_004.phpt
+++ b/tests/output/ob_start_basic_unerasable_004.phpt
@@ -10,12 +10,13 @@ function callback($string) {
ob_start('callback', 0, false);
-echo "This call will fail to flush and fail to obtain the content:\n";
+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 fail to flush and fail to obtain the content:
+[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 callback. in %s on line 11
-bool(false)
+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
diff --git a/tests/output/ob_start_basic_unerasable_005.phpt b/tests/output/ob_start_basic_unerasable_005.phpt
index 7be71e5..2c52f00 100644
--- a/tests/output/ob_start_basic_unerasable_005.phpt
+++ b/tests/output/ob_start_basic_unerasable_005.phpt
@@ -17,9 +17,9 @@ var_dump(ob_get_contents());
?>
--EXPECTF--
[callback:1]Attempt to flush unerasable buffer - should fail...
-Notice: ob_flush(): failed to flush buffer callback. in %s on line 11
+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 callback. in %s on line 11
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11
bool(false)
"
diff --git a/tests/output/ob_start_error_001.phpt b/tests/output/ob_start_error_001.phpt
index ca02801..0f6daf3 100644
--- a/tests/output/ob_start_error_001.phpt
+++ b/tests/output/ob_start_error_001.phpt
@@ -30,19 +30,22 @@ 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
-NULL
+bool(false)
- Arg 1 wrong type
-bool(true)
+
+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, string given in %s on line 23
-NULL
+bool(false)
- Arg 3 wrong type
-bool(true) \ No newline at end of file
+
+Warning: ob_start() expects parameter 3 to be long, string given in %s on line 26
+bool(false)
diff --git a/tests/output/ob_start_error_002.phpt b/tests/output/ob_start_error_002.phpt
index aca2ad9..822aeb4 100644
--- a/tests/output/ob_start_error_002.phpt
+++ b/tests/output/ob_start_error_002.phpt
@@ -20,8 +20,15 @@ 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
diff --git a/tests/output/ob_start_error_003.phpt b/tests/output/ob_start_error_003.phpt
index ce2a249..7bb88b4 100644
--- a/tests/output/ob_start_error_003.phpt
+++ b/tests/output/ob_start_error_003.phpt
@@ -15,4 +15,6 @@ var_dump(ob_start(array($c)));
echo "done"
?>
--EXPECTF--
-Catchable fatal error: Object of class C could not be converted to string in %s on line 11 \ No newline at end of file
+Notice: ob_start(): failed to create buffer in %s on line 11
+bool(false)
+done \ No newline at end of file
diff --git a/tests/output/ob_start_error_004.phpt b/tests/output/ob_start_error_004.phpt
index ec6d44d..aeb5be9 100644
--- a/tests/output/ob_start_error_004.phpt
+++ b/tests/output/ob_start_error_004.phpt
@@ -15,4 +15,6 @@ var_dump(ob_start(array($c, 'f')));
echo "done"
?>
--EXPECTF--
-Catchable fatal error: Object of class C could not be converted to string in %s on line 11 \ No newline at end of file
+Notice: ob_start(): failed to create buffer in %s on line 11
+bool(false)
+done \ No newline at end of file