Revert "1.0.7"

This reverts commit 4a312a37e2.
This commit is contained in:
Joel Male
2024-08-30 10:08:27 +10:00
parent 4a312a37e2
commit 313a4f7aa2
25 changed files with 70 additions and 70 deletions
+10 -10
View File
@@ -1,8 +1,8 @@
<?php
use Pixeldigital\Cart\Cart;
use Pixeldigital\Cart\Tests\Helpers\MockProduct;
use Pixeldigital\Cart\Tests\Helpers\SessionMock;
use Wearepixel\Cart\Cart;
use Wearepixel\Cart\Tests\Helpers\MockProduct;
use Wearepixel\Cart\Tests\Helpers\SessionMock;
beforeEach(function () {
$events = Mockery::mock('Illuminate\Contracts\Events\Dispatcher');
@@ -149,7 +149,7 @@
$item = $this->cart->get(1);
expect($item->attributes)->toBeInstanceOf('Pixeldigital\\Cart\\ItemAttributeCollection');
expect($item->attributes)->toBeInstanceOf('Wearepixel\\Cart\\ItemAttributeCollection');
// now lets update the item with its new attributes
// when we get that item from cart, it should still be an instance of ItemAttributeCollection
@@ -162,7 +162,7 @@
$this->cart->update(1, $updatedItem);
expect($item->attributes)->toBeInstanceOf('Pixeldigital\\Cart\\ItemAttributeCollection');
expect($item->attributes)->toBeInstanceOf('Wearepixel\\Cart\\ItemAttributeCollection');
});
test('item orders are preserved by the order they are added', function () {
@@ -298,19 +298,19 @@
});
test('should throw an exception when no quantity is provided', function () {
$this->expectException('Pixeldigital\Cart\Exceptions\InvalidItemException');
$this->expectException('Wearepixel\Cart\Exceptions\InvalidItemException');
$this->expectExceptionMessage('The quantity must be at least 0.1.');
$this->cart->add(455, 'Sample Item', 100.99, 0, []);
});
test('should throw an exception when no id is provided', function () {
$this->expectException('Pixeldigital\Cart\Exceptions\InvalidItemException');
$this->expectException('Wearepixel\Cart\Exceptions\InvalidItemException');
$this->expectExceptionMessage('The id field is required.');
$this->cart->add('', 'Sample Item', 100.99, 2, []);
});
test('should throw an exception when no name is provided', function () {
$this->expectException('Pixeldigital\Cart\Exceptions\InvalidItemException');
$this->expectException('Wearepixel\Cart\Exceptions\InvalidItemException');
$this->expectExceptionMessage('The name field is required.');
$this->cart->add(523, '', 100.99, 2, []);
});
@@ -646,7 +646,7 @@
expect($this->cart->getContent()->count())->toEqual(1, 'Cart should have 1 item on it');
expect($this->cart->getContent()->first()['id'])->toEqual(456, 'The first content must have ID of 456');
expect($this->cart->getContent()->first()['name'])->toEqual('Sample Item', 'The first content must have name of "Sample Item"');
expect($addedItem->model)->toBeInstanceOf('Pixeldigital\Cart\Tests\Helpers\MockProduct');
expect($addedItem->model)->toBeInstanceOf('Wearepixel\Cart\Tests\Helpers\MockProduct');
});
test('cart can add items with multidimensional array with associated model', function () {
@@ -681,7 +681,7 @@
$content = $this->cart->getContent();
foreach ($content as $item) {
expect($item->model)->toBeInstanceOf('Pixeldigital\Cart\Tests\Helpers\MockProduct');
expect($item->model)->toBeInstanceOf('Wearepixel\Cart\Tests\Helpers\MockProduct');
}
expect($this->cart->isEmpty())->toBeFalse('Cart should not be empty');