]> granicus.if.org Git - php/commitdiff
- Add new test
authorJohannes Schlüter <johannes@php.net>
Mon, 30 Apr 2007 19:52:04 +0000 (19:52 +0000)
committerJohannes Schlüter <johannes@php.net>
Mon, 30 Apr 2007 19:52:04 +0000 (19:52 +0000)
ext/spl/tests/spl_007.phpt [new file with mode: 0755]

diff --git a/ext/spl/tests/spl_007.phpt b/ext/spl/tests/spl_007.phpt
new file mode 100755 (executable)
index 0000000..dcd63f9
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+SPL: iterator_apply() with callback using __call()
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+
+class Foo {
+    public function __call($name, $params) {
+        echo "Called $name.\n";
+        return true;
+    }
+}
+
+$it = new ArrayIterator(array(1, 2, 3));
+
+iterator_apply($it, array(new Foo, "foobar"));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECT--
+Called foobar.
+Called foobar.
+Called foobar.
+===DONE===