Yaffs site version 1.1
[yaffs-website] / vendor / phpunit / phpunit / tests / _files / StackTest.php
diff --git a/vendor/phpunit/phpunit/tests/_files/StackTest.php b/vendor/phpunit/phpunit/tests/_files/StackTest.php
new file mode 100644 (file)
index 0000000..2e29e87
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+class StackTest extends PHPUnit_Framework_TestCase
+{
+    public function testPush()
+    {
+        $stack = array();
+        $this->assertEquals(0, count($stack));
+
+        array_push($stack, 'foo');
+        $this->assertEquals('foo', $stack[count($stack)-1]);
+        $this->assertEquals(1, count($stack));
+
+        return $stack;
+    }
+
+    /**
+     * @depends testPush
+     */
+    public function testPop(array $stack)
+    {
+        $this->assertEquals('foo', array_pop($stack));
+        $this->assertEquals(0, count($stack));
+    }
+}