mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-21 14:55:02 +00:00
Removed Cart facade from coverage (does not provide a public inteterface)
Exclude migrations from coverage Added tests for InstanceIdentifier Added InstanceIdentifier support to store, restore and merge Added weight to CanBeBought trait Excluded CanBeBought trait from coverage temporarily
This commit is contained in:
@@ -547,6 +547,9 @@ class Cart
|
||||
{
|
||||
$content = $this->getContent();
|
||||
|
||||
if ($identifier instanceof InstanceIdentifier)
|
||||
$identifier = $identifier->getInstanceIdentifier();
|
||||
|
||||
if ($this->storedCartWithIdentifierExists($identifier))
|
||||
throw new CartAlreadyStoredException("A cart with identifier {$identifier} was already stored.");
|
||||
|
||||
@@ -567,6 +570,9 @@ class Cart
|
||||
*/
|
||||
public function restore($identifier)
|
||||
{
|
||||
if ($identifier instanceof InstanceIdentifier)
|
||||
$identifier = $identifier->getInstanceIdentifier();
|
||||
|
||||
if( ! $this->storedCartWithIdentifierExists($identifier))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user