Created
April 10, 2013 18:07
-
-
Save phpfiddle/5357022 to your computer and use it in GitHub Desktop.
Enhance-PHP test sample.
This file contains hidden or 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 | |
/** | |
* Enhance-PHP test sample | |
* | |
*/ | |
include_once "enhancephp/EnhanceTestFramework.php"; | |
// your classes and test fixtures | |
class ExampleClass | |
{ | |
public function addTwoNumbers($a, $b) | |
{ | |
return $a + $b; | |
} | |
} | |
class ExampleClassTests extends \Enhance\TestFixture | |
{ | |
private $target; | |
public function setUp() | |
{ | |
$this->target = \Enhance\Core::getCodeCoverageWrapper('ExampleClass'); | |
} | |
public function addTwoNumbersWith3and2Expect5() | |
{ | |
$result = $this->target->addTwoNumbers(3, 2); | |
\Enhance\Assert::areIdentical(5, $result); | |
} | |
public function addTwoNumbersWith4and2Expect6() | |
{ | |
$result = $this->target->addTwoNumbers(4, 2); | |
\Enhance\Assert::areIdentical(6, $result); | |
} | |
} | |
// Run the tests | |
\Enhance\Core::runTests(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment