Yaffs site version 1.1
[yaffs-website] / vendor / phpunit / phpunit / tests / _files / TestIterator2.php
diff --git a/vendor/phpunit/phpunit/tests/_files/TestIterator2.php b/vendor/phpunit/phpunit/tests/_files/TestIterator2.php
new file mode 100644 (file)
index 0000000..3b47fa3
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+class TestIterator2 implements Iterator
+{
+    protected $data;
+
+    public function __construct(array $array)
+    {
+        $this->data = $array;
+    }
+
+    public function current()
+    {
+        return current($this->data);
+    }
+
+    public function next()
+    {
+        next($this->data);
+    }
+
+    public function key()
+    {
+        return key($this->data);
+    }
+
+    public function valid()
+    {
+        return key($this->data) !== null;
+    }
+
+    public function rewind()
+    {
+        reset($this->data);
+    }
+}