1<?php 2class StackTest extends PHPUnit_Framework_TestCase 3{ 4 public function testPush() 5 { 6 $stack = []; 7 $this->assertCount(0, $stack); 8 9 array_push($stack, 'foo'); 10 $this->assertEquals('foo', $stack[count($stack)-1]); 11 $this->assertCount(1, $stack); 12 13 return $stack; 14 } 15 16 /** 17 * @depends testPush 18 */ 19 public function testPop(array $stack) 20 { 21 $this->assertEquals('foo', array_pop($stack)); 22 $this->assertCount(0, $stack); 23 } 24} 25