Skip to content

Instantly share code, notes, and snippets.

@bananaumai
Created October 16, 2011 13:27
Show Gist options
  • Save bananaumai/1290875 to your computer and use it in GitHub Desktop.
Save bananaumai/1290875 to your computer and use it in GitHub Desktop.
<?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の検証失敗')
);
}
}
@bananaumai
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment