Skip to content

Instantly share code, notes, and snippets.

@yuya-takeyama
Created July 17, 2010 04:26
Show Gist options
  • Save yuya-takeyama/479238 to your computer and use it in GitHub Desktop.
Save yuya-takeyama/479238 to your computer and use it in GitHub Desktop.
TDD with PHPUnit #02 http://blog.yuyat.jp/archives/342
<?php
class Calc
{
public function add($a, $b)
{
return $a + $b;
}
}
<?php
require_once 'PHPUnit/Framework.php';
require_once './Calc.php';
class CalcTest extends PHPUnit_Framework_TestCase
{
public function testAdd()
{
$calc = new Calc;
$this->assertEquals(2, $calc->add(1, 1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment