Skip to content

Commit

Permalink
Merge pull request #192 from jmarcher/master
Browse files Browse the repository at this point in the history
Merge with #190
  • Loading branch information
lukepolo authored May 3, 2017
2 parents 191234a + 5ec5980 commit 8ff7fc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Traits/CartOptionsMagicMethodsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function __set($option, $value)
}
break;
case CartItem::ITEM_TAX:
if (!empty($value) && (!is_numeric($value) || $value > 1)) {
throw new InvalidTaxableValue('The tax must be a float less than 1');
if (!empty($value) && (!is_numeric($value))) {
throw new InvalidTaxableValue('The tax must be a number');
}
break;
case CartItem::ITEM_TAXABLE:
Expand Down
4 changes: 2 additions & 2 deletions tests/MagicFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public function testSet()
$this->assertEquals(123, $item->test_option);

try {
$item->tax = 2;
$item->tax = 'not_a_number';
$this->setExpectedException(InvalidTaxableValue::class);
} catch (InvalidTaxableValue $e) {
$this->assertEquals('The tax must be a float less than 1', $e->getMessage());
$this->assertEquals('The tax must be a number', $e->getMessage());
}

try {
Expand Down

0 comments on commit 8ff7fc1

Please sign in to comment.