Skip to content

Instantly share code, notes, and snippets.

@snize
Created March 18, 2013 07:40
Show Gist options
  • Save snize/5185618 to your computer and use it in GitHub Desktop.
Save snize/5185618 to your computer and use it in GitHub Desktop.
<?php namespace App;
class Calc
{
public function add($a, $b)
{
return $a + $b;
}
}
<?php
require 'app/calc.php';
use App\Calc;
class CalculatorTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->calc = new Calc;
}
public function testAdd()
{
$this->assertEquals(3, $this->calc->add(1, 2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment