mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 22:01:48 +00:00
test: add setSessionKey test to DatabaseDriverTest
This commit is contained in:
@@ -68,4 +68,12 @@
|
||||
test('getSessionModel returns the Eloquent model', function () {
|
||||
expect($this->driver->getSessionModel())->toBeInstanceOf(MockCartModel::class);
|
||||
});
|
||||
|
||||
test('setSessionKey updates the session key on the model', function () {
|
||||
$this->driver->putItems([['id' => 1]]);
|
||||
$this->driver->setSessionKey('new-session');
|
||||
|
||||
expect($this->driver->getSessionKey())->toBe('new-session');
|
||||
expect($this->driver->getItems())->toBe([['id' => 1]]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user