public
Last active

Tab or space?

  • Download Gist
test.php
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"),
);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.