Created
April 2, 2015 10:18
-
-
Save dancourse/5ee17a596223c10d5648 to your computer and use it in GitHub Desktop.
Simple PHPunit provider example
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
class ScoringTest extends TestCase | |
{ | |
/** | |
* Some Grades | |
*/ | |
public static function all_grades_provider() | |
{ | |
return [ | |
[100.00], | |
[50.00], | |
[0], | |
]; | |
} | |
/** | |
* Grade checks | |
* @dataProvider all_grades_provider | |
* @return void | |
*/ | |
public function test_grade_score_is_correct ($grade) | |
{ | |
// test our total is correct | |
$this->assertEquals($grade, Score::someFunctionWhichAffectsGrade($grade)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment