Skip to content

Instantly share code, notes, and snippets.

@jlamim
Created August 29, 2016 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlamim/6aeee542c07c8201889ef7990b7fc64e to your computer and use it in GitHub Desktop.
Save jlamim/6aeee542c07c8201889ef7990b7fc64e to your computer and use it in GitHub Desktop.
Testes Unitários com PHPUnit no CodeIgniter
<?php
class SampleTest extends PHPUnit_Framework_TestCase
{
public function testPushAndPop()
{
$stack = array();
$this->assertEquals(0, count($stack));
array_push($stack, 'foo');
$this->assertEquals('foo', $stack[count($stack)-1]);
$this->assertEquals(1, count($stack));
$this->assertEquals('foo', array_pop($stack));
$this->assertEquals(0, count($stack));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment