Created
October 16, 2011 13:27
-
-
Save bananaumai/1290875 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 | |
require_once 'FizzBuzz.php'; | |
class FizzBuzzTest extends PHPUnit_Framework_TestCase | |
{ | |
/** | |
* makeFizzBuzz | |
* @dataProvider provideMakeFizzBuzz | |
*/ | |
public function test_makeFizzBuzz($expected, $no, $message) | |
{ | |
$this->assertEquals($expected, FizzBuzz::makeFizzBuzz($no), $message); | |
} | |
public function provideMakeFizzBuzz() | |
{ | |
return array( | |
array('1', 2, '1の時は1の検証失敗'), | |
array('Fizz', 4, '3の倍数の時はFizzの検証失敗'), | |
array('Buzz', 6, '5の倍数の時はBuzzの検証失敗'), | |
array('FizzBuzz', 16, '3かつ5の倍数の時はFizzBuzzの検証失敗') | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
元ネタ https://github.com/shin1x1/event/wiki/PHP-Matsuri-Workshop-TDD