Example #1
0
 public function testAmountIsValid()
 {
     $validator = new Validator();
     $result = $validator->amountIsValid(10, 200, 10);
     $this->assertFalse($result);
     $result = $validator->amountIsValid(10, 90, 10);
     $this->assertTrue($result);
 }
Example #2
0
 /**
  * Check whether the given amount is greater than
  * a multiple of the average
  *
  * @param int|float $average Average value
  * @param int|float $amount Incoming value
  * @return bool
  */
 public function amountIsValid($average, $amount)
 {
     $validator = new Validator();
     return $validator->amountIsValid($average, $amount, $this->valid_amount_multiplier);
 }