Created
March 18, 2013 07:40
-
-
Save snize/5185618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App; | |
class Calc | |
{ | |
public function add($a, $b) | |
{ | |
return $a + $b; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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