Ejemplo n.º 1
0
 /**
  * Generate a random currency value.
  *
  * Currency values are never stored with more than two digits of precision.
  */
 public function testFluffCurrency()
 {
     // Generate a random currency amount
     $random_dollar = Fluffer::fluffCurrency();
     // Make sure the number is precise to only three significant digits
     $rounded_dollar = round($random_dollar, 2);
     $this->assertEquals($rounded_dollar, $random_dollar, 0.005);
 }
Ejemplo n.º 2
0
 public function testFluffTimestamp()
 {
     // Generate a random timestamp
     $random_timestamp = Fluffer::fluffTimestamp();
     // Make sure the timestamp is a integer in seconds since the epoch
     $this->assertTrue(is_int($random_timestamp), "The timestamp should be a number");
 }