diff --git a/composer.json b/composer.json index 951253f..a3d0f26 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ "laravel/framework": "^5.5||^6.0||^7.0||^8.0||^9.0" }, "require-dev": { - "orchestra/testbench": "~3.0", - "phpunit/phpunit": "^7.0", + "orchestra/testbench": "~5.0", + "phpunit/phpunit": "^8.0", "php-coveralls/php-coveralls": "^2.1", "doctrine/dbal": "^1.0||^2.0" }, diff --git a/src/Interfaces/Basketable.php b/src/Interfaces/Basketable.php index e448018..4ee52d0 100644 --- a/src/Interfaces/Basketable.php +++ b/src/Interfaces/Basketable.php @@ -4,7 +4,7 @@ interface Basketable { - public function getPrice(); + public function getPrice($basketItemMeta = null); public function getName(); } diff --git a/src/Models/BasketItem.php b/src/Models/BasketItem.php index 0f03be6..ced9313 100644 --- a/src/Models/BasketItem.php +++ b/src/Models/BasketItem.php @@ -29,6 +29,6 @@ public function setQuantity(int $quantity) public function getPrice() { - return $this->quantity * $this->basketable->getPrice(); + return $this->quantity * $this->basketable->getPrice($this->meta); } } diff --git a/tests/Models/Product.php b/tests/Models/Product.php index d51dbca..e0119f0 100644 --- a/tests/Models/Product.php +++ b/tests/Models/Product.php @@ -7,7 +7,7 @@ class Product extends Model implements Basketable { - public function getPrice() + public function getPrice($basketItemMeta = null) { return $this->price; }