Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Tab or space?
class AnimalSoundSystemTest extends PHPUnit_Framework_TestCase
* @dataProvider provideAnimalsAndSounds
public function testAnimalsSounds(Animal $animal, $expected_sound)
$this->assertEquals($expected_sound, $animal->speak());
public function provideAnimalsAndSounds()
return array(
"Dog goes woof" => array(new Dog(), "woof"),
"Mouse goes squeek" => array(new Mouse(), "squeek"),
"Elephant goes toot" => array(new Elephant(), "toot"),
"What does the fox say" => array(new Fox(), "Ring-ding-ding-ding-dingeringeding"),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.