mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 15:41:24 +00:00
Added a new associate method, to associate a row in the cart with a model, so you can access the model from the CartRowCollection
This commit is contained in:
5
tests/helpers/NamespacedProductModelStub.php
Normal file
5
tests/helpers/NamespacedProductModelStub.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php namespace Acme\Test\Models;
|
||||
class TestProduct {
|
||||
public $description = 'This is the description of the namespaced test model';
|
||||
public function find($id) { return $this; }
|
||||
}
|
||||
6
tests/helpers/ProductModelStub.php
Normal file
6
tests/helpers/ProductModelStub.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
class TestProduct {
|
||||
public $description = 'This is the description of the test model';
|
||||
public function find($id) { return $this; }
|
||||
}
|
||||
17
tests/helpers/SessionMock.php
Normal file
17
tests/helpers/SessionMock.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class SessionMock {
|
||||
protected $session;
|
||||
public function has($key)
|
||||
{
|
||||
return isset($this->session[$key]);
|
||||
}
|
||||
public function get($key)
|
||||
{
|
||||
return $this->session[$key];
|
||||
}
|
||||
public function put($key, $value)
|
||||
{
|
||||
$this->session[$key] = $value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user