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