mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +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:
51
tests/Fixtures/Identifiable.php
Normal file
51
tests/Fixtures/Identifiable.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Gloudemans\Tests\Shoppingcart\Fixtures;
|
||||
|
||||
use Gloudemans\Shoppingcart\Contracts\InstanceIdentifier;
|
||||
|
||||
class Identifiable implements InstanceIdentifier
|
||||
{
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
private $identifier;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $discountRate;
|
||||
|
||||
/**
|
||||
* BuyableProduct constructor.
|
||||
*
|
||||
* @param int|string $id
|
||||
* @param string $name
|
||||
* @param float $price
|
||||
*/
|
||||
public function __construct($identifier = 'identifier', $discountRate = 0)
|
||||
{
|
||||
$this->identifier = $identifier;
|
||||
$this->discountRate = $discountRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the unique identifier to load the Cart from
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function getInstanceIdentifier($options = null)
|
||||
{
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the unique identifier to load the Cart from
|
||||
*
|
||||
* @return int|string
|
||||
*/
|
||||
public function getInstanceGlobalDiscount($options = null)
|
||||
{
|
||||
return $this->discountRate;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user