|
|
|
@ -31,4 +31,14 @@ class ProductTest extends TestCase |
|
|
|
$this->assertEquals($product->credit_price, $product->getPrice('credit')); |
|
|
|
$this->assertEquals(3000, $product->getPrice('credit')); |
|
|
|
} |
|
|
|
|
|
|
|
/** @test */ |
|
|
|
public function product_get_price_returns_cash_price_if_credit_price_is_0_or_null() |
|
|
|
{ |
|
|
|
$product = new Product(['cash_price' => 2000, 'credit_price' => 0]); |
|
|
|
$this->assertEquals(2000, $product->getPrice('credit')); |
|
|
|
|
|
|
|
$product = new Product(['cash_price' => 2000, 'credit_price' => null]); |
|
|
|
$this->assertEquals(2000, $product->getPrice('credit')); |
|
|
|
} |
|
|
|
} |