This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 27th, 2012  |  syntax: None  |  size: 0.52 KB  |  views: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/env php
  2. <?php
  3. require_once 'lime.php';
  4.  
  5. $t = new lime_test;
  6.  
  7. function fizzbuzz($num)
  8. {
  9.     if ($num <= 0) {
  10.         return 0;
  11.     } elseif ($num % 15 === 0) {
  12.         return "fizzbuzz";
  13.     } elseif ($num % 3 === 0) {
  14.         return "fizz";
  15.     } elseif ($num % 5 === 0) {
  16.         return "buzz";
  17.     }
  18.  
  19.     return $num;
  20. }
  21.  
  22. $t->is(fizzbuzz(-1), 0);
  23. $t->is(fizzbuzz(0), 0);
  24.  
  25. $t->is(fizzbuzz(1), 1);
  26. $t->is(fizzbuzz(3), "fizz");
  27. $t->is(fizzbuzz(5), "buzz");
  28. $t->is(fizzbuzz(15), "fizzbuzz");
  29.  
  30. #$t->ok();
  31. #$t->is_deeply();
clone this paste RAW Paste Data