]> granicus.if.org Git - php/commitdiff
Backport ob test to php 5.2 and 53.
authorandy wharmby <wharmby@php.net>
Sun, 14 Jun 2009 16:47:11 +0000 (16:47 +0000)
committerandy wharmby <wharmby@php.net>
Sun, 14 Jun 2009 16:47:11 +0000 (16:47 +0000)
tests/output/ob_001.phpt [new file with mode: 0644]
tests/output/ob_002.phpt [new file with mode: 0644]
tests/output/ob_003.phpt [new file with mode: 0644]
tests/output/ob_004.phpt [new file with mode: 0644]
tests/output/ob_005.phpt [new file with mode: 0644]
tests/output/ob_006.phpt [new file with mode: 0644]
tests/output/ob_007.phpt [new file with mode: 0644]
tests/output/ob_008.phpt [new file with mode: 0644]
tests/output/ob_009.phpt [new file with mode: 0644]
tests/output/ob_010.phpt [new file with mode: 0644]

diff --git a/tests/output/ob_001.phpt b/tests/output/ob_001.phpt
new file mode 100644 (file)
index 0000000..ecacf02
--- /dev/null
@@ -0,0 +1,8 @@
+--TEST--
+output buffering - nothing
+--FILE--
+<?php
+echo "foo\n";
+?>
+--EXPECT--
+foo
diff --git a/tests/output/ob_002.phpt b/tests/output/ob_002.phpt
new file mode 100644 (file)
index 0000000..94f515b
--- /dev/null
@@ -0,0 +1,9 @@
+--TEST--
+output buffering - ob_start
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+?>
+--EXPECT--
+foo
diff --git a/tests/output/ob_003.phpt b/tests/output/ob_003.phpt
new file mode 100644 (file)
index 0000000..988d197
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+output buffering - ob_flush
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_flush();
+echo "bar\n";
+ob_flush();
+?>
+--EXPECT--
+foo
+bar
diff --git a/tests/output/ob_004.phpt b/tests/output/ob_004.phpt
new file mode 100644 (file)
index 0000000..a089a8c
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+output buffering - ob_clean
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_clean();
+echo "bar\n";
+?>
+--EXPECT--
+bar
diff --git a/tests/output/ob_005.phpt b/tests/output/ob_005.phpt
new file mode 100644 (file)
index 0000000..bbe807d
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+output buffering - ob_end_clean
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_start();
+echo "bar\n";
+ob_end_clean();
+echo "baz\n";
+?>
+--EXPECT--
+foo
+baz
diff --git a/tests/output/ob_006.phpt b/tests/output/ob_006.phpt
new file mode 100644 (file)
index 0000000..aec3cfc
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+output buffering - ob_end_flush
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_end_flush();
+var_dump(ob_get_level());
+?>
+--EXPECT--
+foo
+int(0)
diff --git a/tests/output/ob_007.phpt b/tests/output/ob_007.phpt
new file mode 100644 (file)
index 0000000..059925c
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+output buffering - ob_get_clean
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+var_dump(ob_get_clean());
+?>
+--EXPECT--
+string(4) "foo
+"
diff --git a/tests/output/ob_008.phpt b/tests/output/ob_008.phpt
new file mode 100644 (file)
index 0000000..17a8081
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+output buffering - ob_get_contents
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+echo ob_get_contents();
+?>
+--EXPECT--
+foo
+foo
diff --git a/tests/output/ob_009.phpt b/tests/output/ob_009.phpt
new file mode 100644 (file)
index 0000000..80edb46
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+output buffering - ob_get_flush
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+var_dump(ob_get_flush());
+?>
+--EXPECT--
+foo
+string(4) "foo
+"
diff --git a/tests/output/ob_010.phpt b/tests/output/ob_010.phpt
new file mode 100644 (file)
index 0000000..24d650c
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+output buffering - fatalism
+--FILE--
+<?php
+function obh($s)
+{
+       print_r($s, 1);
+}
+ob_start("obh");
+echo "foo\n";
+?>
+--EXPECTF--
+Fatal error: print_r(): Cannot use output buffering in output buffering display handlers in %sob_010.php on line %d