Skip to content

@attilammagyar /test.php
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tab or space?
<?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.