public function checkCondition($value) { assert(is_string($value) || is_numeric($value)); if (parent::checkCondition($value)) { return true; } $value = BCMath::bcconv($value); return (bool) (bccomp($value, $this->lowMin) > -1 && bccomp($value, $this->lowMax) < 1 || bccomp($value, '0') === 0 || bccomp($value, $this->highMin) > -1 && bccomp($value, $this->highMax) < 1); }
/** * @dataProvider checkConditionProvider * @covers empire\framework\db\schema\type\DataFormatCondition::checkCondition */ public function testCheckCondition($value, $result) { $condition = new DataFormatCondition(); $this->assertSame($result, $condition->checkCondition($value)); }