示例#1
0
 /**
  * @depends testPushOne
  */
 function testPeekOne()
 {
     $stack = new LinkedStack();
     $stack->push(1);
     $item = $stack->last();
     $this->assertEquals(1, $item);
     $this->assertFalse($stack->isEmpty());
     $this->assertCount(1, $stack);
 }
示例#2
0
 /**
  * @expectedException \Collections\EmptyException
  */
 function testPeekEmpty()
 {
     $stack = new LinkedStack();
     $stack->last();
 }