private function hasNumber($i, $n) { $i = (string) $i; $n = (string) $n; if (strpos($i, $n) === false && $i !== $n) { return false; } else { return true; } } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>FizzBuzz!</title> <style type="text/css" media="all"> body {background:#eee;color:#333;text-shadow:0px 1px 0px #fff;font-family:sans-serif;} .fb {font-size:1.2em;font-weight:bold;} </style> </head> <body> <h1>FizzBuzz!</h1> <?php $c = new FizzBuzz(); $c->execute(); ?> </body> </html>
public function testNumberOutputOnNotMultipleOf3() { $this->assertSame(7, $this->fizzBuzz->execute(7)); }