public function testAmountIsValid() { $validator = new Validator(); $result = $validator->amountIsValid(10, 200, 10); $this->assertFalse($result); $result = $validator->amountIsValid(10, 90, 10); $this->assertTrue($result); }
/** * 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); }