Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Tab or space?

View test.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<?php
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.