mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +00:00
Update CartTest.php
Added Test for CartItem.php invalid weight exception.
This commit is contained in:
@@ -263,6 +263,19 @@ class CartTest extends TestCase
|
|||||||
|
|
||||||
$cart->add(1, 'Some title', 1, 'invalid');
|
$cart->add(1, 'Some title', 1, 'invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
*/
|
||||||
|
public function it_will_validate_the_weight()
|
||||||
|
{
|
||||||
|
$this->expectException(\InvalidArgumentException::class);
|
||||||
|
$this->expectExceptionMessage('Please supply a valid weight');
|
||||||
|
|
||||||
|
$cart = $this->getCart();
|
||||||
|
|
||||||
|
$cart->add(1, 'Some title', 1, 10.00, 'invalid');
|
||||||
|
}
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function it_will_update_the_cart_if_the_item_already_exists_in_the_cart()
|
public function it_will_update_the_cart_if_the_item_already_exists_in_the_cart()
|
||||||
|
|||||||
Reference in New Issue
Block a user