test: update existing tests to use CartDriver

This commit is contained in:
Joel Male
2026-05-27 21:09:40 +10:00
parent 9abf6a7a1b
commit 0c27ac4d9a
7 changed files with 26 additions and 28 deletions
+8 -4
View File
@@ -2,19 +2,23 @@
use Wearepixel\Cart\Cart;
use Wearepixel\Cart\CartCondition;
use Wearepixel\Cart\Drivers\DatabaseDriver;
use Wearepixel\Cart\Tests\Helpers\MockCartModel;
beforeEach(function () {
$events = Mockery::mock('Illuminate\Contracts\Events\Dispatcher');
$events->shouldReceive('dispatch');
$storage = new MockCartModel;
$this->cart = new Cart(
$storage,
new DatabaseDriver(
MockCartModel::class,
'session_id',
'items',
'conditions',
'SAMPLESESSIONKEY',
),
$events,
'cart',
'SAMPLESESSIONKEY',
require (__DIR__ . '/../Helpers/ConfigDatabaseMock.php')
);
});