diff --git a/composer.json b/composer.json index 7056de9..13e0f48 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "league/omnipay": "^3", "omnipay/stripe": "3.1.x-dev#37df2a791e8feab45543125f4c5f22d5d305096d", "moneyphp/money": "^3.1", - "illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0" + "illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0" }, "require-dev": { "vlucas/phpdotenv": "^2.4", diff --git a/src/Cart/Cart.php b/src/Cart/Cart.php index 87e86d4..77f9415 100644 --- a/src/Cart/Cart.php +++ b/src/Cart/Cart.php @@ -2,10 +2,10 @@ namespace Happypixels\Shopr\Cart; -use Illuminate\Support\Collection; +use Happypixels\Shopr\Contracts\Shoppable; use Happypixels\Shopr\Models\Order; use Happypixels\Shopr\Money\Formatter; -use Happypixels\Shopr\Contracts\Shoppable; +use Illuminate\Support\Collection; abstract class Cart { @@ -28,7 +28,7 @@ abstract public function persist($data); * * @return Collection */ - public function getAllItems() : Collection + public function getAllItems(): Collection { return collect($this->get()); } @@ -38,7 +38,7 @@ public function getAllItems() : Collection * * @return Collection */ - public function items() : Collection + public function items(): Collection { return $this->getAllItems()->filter(function ($item) { return $item->shoppable->isDiscount() === false; @@ -50,7 +50,7 @@ public function items() : Collection * * @return Collection */ - public function discounts() : Collection + public function discounts(): Collection { return $this->getAllItems()->filter(function ($item) { return $item->shoppable->isDiscount() === true; @@ -62,7 +62,7 @@ public function discounts() : Collection * * @return Collection */ - public function relativeDiscounts() : Collection + public function relativeDiscounts(): Collection { return $this->discounts()->filter(function ($discount) { return ! $discount->shoppable->is_fixed; @@ -203,7 +203,7 @@ public function addDiscount(Shoppable $coupon) * @param string $code * @return bool */ - public function hasDiscount($code = null) : bool + public function hasDiscount($code = null): bool { foreach ($this->discounts() as $item) { if (! $code) { @@ -290,7 +290,7 @@ public function convertToOrder($gateway, $data = []) * @param float|null $price * @return Happypixels\Shopr\Cart\CartItem */ - public function addItem($shoppableType, $shoppableId, $quantity = 1, $options = [], $subItems = [], $price = null) : CartItem + public function addItem($shoppableType, $shoppableId, $quantity = 1, $options = [], $subItems = [], $price = null): CartItem { $quantity = (is_numeric($quantity) && $quantity > 0) ? $quantity : 1; diff --git a/src/Contracts/Shoppable.php b/src/Contracts/Shoppable.php index 425a370..5f7c5c6 100644 --- a/src/Contracts/Shoppable.php +++ b/src/Contracts/Shoppable.php @@ -10,5 +10,5 @@ public function getTitle(); public function getPrice(); - public function isDiscount() : bool; + public function isDiscount(): bool; } diff --git a/src/Controllers/CartDiscountController.php b/src/Controllers/CartDiscountController.php index e88ce28..cfc893d 100644 --- a/src/Controllers/CartDiscountController.php +++ b/src/Controllers/CartDiscountController.php @@ -2,11 +2,11 @@ namespace Happypixels\Shopr\Controllers; -use Illuminate\Http\Request; use Happypixels\Shopr\Cart\Cart; -use Illuminate\Routing\Controller; use Happypixels\Shopr\Models\DiscountCoupon; use Illuminate\Foundation\Validation\ValidatesRequests; +use Illuminate\Http\Request; +use Illuminate\Routing\Controller; class CartDiscountController extends Controller { diff --git a/src/Controllers/CartItemController.php b/src/Controllers/CartItemController.php index af9792e..4dd2083 100644 --- a/src/Controllers/CartItemController.php +++ b/src/Controllers/CartItemController.php @@ -2,11 +2,11 @@ namespace Happypixels\Shopr\Controllers; -use Illuminate\Http\Request; use Happypixels\Shopr\Cart\Cart; -use Illuminate\Routing\Controller; use Happypixels\Shopr\Rules\Discounts\NotADiscount; use Illuminate\Foundation\Validation\ValidatesRequests; +use Illuminate\Http\Request; +use Illuminate\Routing\Controller; class CartItemController extends Controller { diff --git a/src/Controllers/CheckoutController.php b/src/Controllers/CheckoutController.php index f9ddb50..fea0e49 100644 --- a/src/Controllers/CheckoutController.php +++ b/src/Controllers/CheckoutController.php @@ -2,10 +2,10 @@ namespace Happypixels\Shopr\Controllers; -use Illuminate\Http\Request; use Happypixels\Shopr\Cart\Cart; -use Illuminate\Routing\Controller; use Happypixels\Shopr\PaymentProviders\PaymentProviderManager; +use Illuminate\Http\Request; +use Illuminate\Routing\Controller; class CheckoutController extends Controller { diff --git a/src/Controllers/Web/OrderController.php b/src/Controllers/Web/OrderController.php index bb291d0..83891f8 100644 --- a/src/Controllers/Web/OrderController.php +++ b/src/Controllers/Web/OrderController.php @@ -2,8 +2,8 @@ namespace Happypixels\Shopr\Controllers\Web; -use Illuminate\Routing\Controller; use Happypixels\Shopr\Models\Order; +use Illuminate\Routing\Controller; class OrderController extends Controller { diff --git a/src/Controllers/Web/PaymentConfirmationController.php b/src/Controllers/Web/PaymentConfirmationController.php index 008ebe2..b1af738 100644 --- a/src/Controllers/Web/PaymentConfirmationController.php +++ b/src/Controllers/Web/PaymentConfirmationController.php @@ -2,11 +2,11 @@ namespace Happypixels\Shopr\Controllers\Web; -use Illuminate\Http\Request; -use Illuminate\Routing\Controller; -use Happypixels\Shopr\Models\Order; use Happypixels\Shopr\Exceptions\PaymentFailedException; +use Happypixels\Shopr\Models\Order; use Happypixels\Shopr\PaymentProviders\PaymentProviderManager; +use Illuminate\Http\Request; +use Illuminate\Routing\Controller; class PaymentConfirmationController extends Controller { diff --git a/src/Mails/OrderCreatedAdmins.php b/src/Mails/OrderCreatedAdmins.php index ca5b14d..a0103a3 100644 --- a/src/Mails/OrderCreatedAdmins.php +++ b/src/Mails/OrderCreatedAdmins.php @@ -2,9 +2,9 @@ namespace Happypixels\Shopr\Mails; +use Happypixels\Shopr\Models\Order; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; -use Happypixels\Shopr\Models\Order; use Illuminate\Queue\SerializesModels; class OrderCreatedAdmins extends Mailable diff --git a/src/Mails/OrderCreatedCustomer.php b/src/Mails/OrderCreatedCustomer.php index 9473640..d38fbbd 100644 --- a/src/Mails/OrderCreatedCustomer.php +++ b/src/Mails/OrderCreatedCustomer.php @@ -2,9 +2,9 @@ namespace Happypixels\Shopr\Mails; +use Happypixels\Shopr\Models\Order; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; -use Happypixels\Shopr\Models\Order; use Illuminate\Queue\SerializesModels; class OrderCreatedCustomer extends Mailable diff --git a/src/Models/DiscountCoupon.php b/src/Models/DiscountCoupon.php index a705567..22eb15e 100644 --- a/src/Models/DiscountCoupon.php +++ b/src/Models/DiscountCoupon.php @@ -83,7 +83,7 @@ public function getCalculatedPositiveValue() * * @return bool */ - public function isDiscount() : bool + public function isDiscount(): bool { return true; } diff --git a/src/Models/Shoppable.php b/src/Models/Shoppable.php index 6063496..1acce6a 100644 --- a/src/Models/Shoppable.php +++ b/src/Models/Shoppable.php @@ -2,8 +2,8 @@ namespace Happypixels\Shopr\Models; -use Illuminate\Database\Eloquent\Model; use Happypixels\Shopr\Contracts\Shoppable as ShoppableContract; +use Illuminate\Database\Eloquent\Model; class Shoppable extends Model implements ShoppableContract { @@ -42,7 +42,7 @@ public function getPrice() * * @return bool */ - public function isDiscount() : bool + public function isDiscount(): bool { return false; } diff --git a/src/Money/Formatter.php b/src/Money/Formatter.php index 30a1441..9ad0d45 100644 --- a/src/Money/Formatter.php +++ b/src/Money/Formatter.php @@ -2,11 +2,11 @@ namespace Happypixels\Shopr\Money; -use Money\Money; -use Money\Currency; -use NumberFormatter; use Money\Currencies\ISOCurrencies; +use Money\Currency; use Money\Formatter\IntlMoneyFormatter; +use Money\Money; +use NumberFormatter; class Formatter { diff --git a/src/Observers/OrderObserver.php b/src/Observers/OrderObserver.php index bb5a783..8bb2d3a 100644 --- a/src/Observers/OrderObserver.php +++ b/src/Observers/OrderObserver.php @@ -3,10 +3,10 @@ namespace Happypixels\Shopr\Observers; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Models\Order; -use Illuminate\Support\Facades\Mail; use Happypixels\Shopr\Mails\OrderCreatedAdmins; use Happypixels\Shopr\Mails\OrderCreatedCustomer; +use Happypixels\Shopr\Models\Order; +use Illuminate\Support\Facades\Mail; class OrderObserver { diff --git a/src/PaymentProviders/PaymentProvider.php b/src/PaymentProviders/PaymentProvider.php index a0f2a09..2f791ce 100644 --- a/src/PaymentProviders/PaymentProvider.php +++ b/src/PaymentProviders/PaymentProvider.php @@ -2,12 +2,12 @@ namespace Happypixels\Shopr\PaymentProviders; -use Omnipay\Omnipay; -use Illuminate\Support\Str; -use Illuminate\Http\Request; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Models\Order; use Happypixels\Shopr\Exceptions\PaymentFailedException; +use Happypixels\Shopr\Models\Order; +use Illuminate\Http\Request; +use Illuminate\Support\Str; +use Omnipay\Omnipay; abstract class PaymentProvider { @@ -35,7 +35,7 @@ abstract public function purchase(); * * @return array */ - abstract public function getPaymentConfirmationData() : array; + abstract public function getPaymentConfirmationData(): array; /** * Makes the purchase and returns the results if successful. Throws exception if unsuccessful. diff --git a/src/PaymentProviders/PaymentProviderManager.php b/src/PaymentProviders/PaymentProviderManager.php index 207451d..9732e5f 100644 --- a/src/PaymentProviders/PaymentProviderManager.php +++ b/src/PaymentProviders/PaymentProviderManager.php @@ -2,8 +2,8 @@ namespace Happypixels\Shopr\PaymentProviders; -use Illuminate\Http\Request; use Happypixels\Shopr\Exceptions\InvalidGatewayException; +use Illuminate\Http\Request; class PaymentProviderManager { diff --git a/src/PaymentProviders/Stripe.php b/src/PaymentProviders/Stripe.php index 70c26e5..3634cb8 100644 --- a/src/PaymentProviders/Stripe.php +++ b/src/PaymentProviders/Stripe.php @@ -28,7 +28,7 @@ public function purchase() * * @return array */ - public function getPaymentConfirmationData() : array + public function getPaymentConfirmationData(): array { return [ 'paymentIntentReference' => $this->input['payment_intent'], diff --git a/src/Rules/Discounts/CartValueAboveCouponLimit.php b/src/Rules/Discounts/CartValueAboveCouponLimit.php index adcdad1..0aacee0 100644 --- a/src/Rules/Discounts/CartValueAboveCouponLimit.php +++ b/src/Rules/Discounts/CartValueAboveCouponLimit.php @@ -3,8 +3,8 @@ namespace Happypixels\Shopr\Rules\Discounts; use Happypixels\Shopr\Cart\Cart; -use Illuminate\Contracts\Validation\Rule; use Happypixels\Shopr\Models\DiscountCoupon; +use Illuminate\Contracts\Validation\Rule; class CartValueAboveCouponLimit implements Rule { diff --git a/src/Rules/Discounts/CouponExists.php b/src/Rules/Discounts/CouponExists.php index 0ab2b67..c89fa07 100644 --- a/src/Rules/Discounts/CouponExists.php +++ b/src/Rules/Discounts/CouponExists.php @@ -2,8 +2,8 @@ namespace Happypixels\Shopr\Rules\Discounts; -use Illuminate\Contracts\Validation\Rule; use Happypixels\Shopr\Models\DiscountCoupon; +use Illuminate\Contracts\Validation\Rule; class CouponExists implements Rule { diff --git a/src/Rules/Discounts/DateIsWithinCouponTimespan.php b/src/Rules/Discounts/DateIsWithinCouponTimespan.php index 87a97ea..bd2dc76 100644 --- a/src/Rules/Discounts/DateIsWithinCouponTimespan.php +++ b/src/Rules/Discounts/DateIsWithinCouponTimespan.php @@ -2,8 +2,8 @@ namespace Happypixels\Shopr\Rules\Discounts; -use Illuminate\Contracts\Validation\Rule; use Happypixels\Shopr\Models\DiscountCoupon; +use Illuminate\Contracts\Validation\Rule; class DateIsWithinCouponTimespan implements Rule { diff --git a/src/ShoprServiceProvider.php b/src/ShoprServiceProvider.php index ea9acc4..ecddc9a 100644 --- a/src/ShoprServiceProvider.php +++ b/src/ShoprServiceProvider.php @@ -3,13 +3,13 @@ namespace Happypixels\Shopr; use Happypixels\Shopr\Cart\Cart; +use Happypixels\Shopr\Cart\Drivers\SessionCart; use Happypixels\Shopr\Models\Order; -use Illuminate\Support\Facades\Event; -use Happypixels\Shopr\Money\Formatter; use Happypixels\Shopr\Models\OrderItem; -use Illuminate\Support\ServiceProvider; +use Happypixels\Shopr\Money\Formatter; use Happypixels\Shopr\Observers\OrderObserver; -use Happypixels\Shopr\Cart\Drivers\SessionCart; +use Illuminate\Support\Facades\Event; +use Illuminate\Support\ServiceProvider; class ShoprServiceProvider extends ServiceProvider { diff --git a/tests/Feature/Cart/AddCartItemTest.php b/tests/Feature/Cart/AddCartItemTest.php index d3f77a1..874e24a 100644 --- a/tests/Feature/Cart/AddCartItemTest.php +++ b/tests/Feature/Cart/AddCartItemTest.php @@ -3,8 +3,8 @@ namespace Happypixels\Shopr\Tests\Feature\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; +use Happypixels\Shopr\Tests\TestCase; class AddCartItemTest extends TestCase { @@ -35,9 +35,9 @@ public function discounts_are_not_allowed() public function it_throws_404_error_if_shoppable_is_not_found() { $this->json('POST', 'api/shopr/cart/items', [ - 'shoppable_id' => 2, - 'shoppable_type' => 'Happypixels\Shopr\Tests\Support\Models\TestShoppable', - ]) + 'shoppable_id' => 2, + 'shoppable_type' => 'Happypixels\Shopr\Tests\Support\Models\TestShoppable', + ]) ->assertStatus(404); } diff --git a/tests/Feature/Cart/CartControllerTest.php b/tests/Feature/Cart/CartControllerTest.php index 21b0eee..01aa70e 100644 --- a/tests/Feature/Cart/CartControllerTest.php +++ b/tests/Feature/Cart/CartControllerTest.php @@ -3,9 +3,9 @@ namespace Happypixels\Shopr\Tests\Feature\Cart; use Happypixels\Shopr\Cart\Cart; +use Happypixels\Shopr\Tests\Support\Models\TestShoppable; use Happypixels\Shopr\Tests\TestCase; use Illuminate\Support\Facades\Event; -use Happypixels\Shopr\Tests\Support\Models\TestShoppable; class CartControllerTest extends TestCase { diff --git a/tests/Feature/Cart/RemoveCartItemTest.php b/tests/Feature/Cart/RemoveCartItemTest.php index d60f588..6091a33 100644 --- a/tests/Feature/Cart/RemoveCartItemTest.php +++ b/tests/Feature/Cart/RemoveCartItemTest.php @@ -3,10 +3,10 @@ namespace Happypixels\Shopr\Tests\Feature\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; -use Illuminate\Support\Facades\Event; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Support\Facades\Event; class RemoveCartItemTest extends TestCase { diff --git a/tests/Feature/Cart/UpdateCartItemTest.php b/tests/Feature/Cart/UpdateCartItemTest.php index 641a84d..b2b8a7c 100644 --- a/tests/Feature/Cart/UpdateCartItemTest.php +++ b/tests/Feature/Cart/UpdateCartItemTest.php @@ -3,10 +3,10 @@ namespace Happypixels\Shopr\Tests\Feature\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; -use Illuminate\Support\Facades\Event; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Support\Facades\Event; class UpdateCartItemTest extends TestCase { diff --git a/tests/Feature/Mails/OrderCreatedAdminsMailTest.php b/tests/Feature/Mails/OrderCreatedAdminsMailTest.php index a7586e7..f11499b 100644 --- a/tests/Feature/Mails/OrderCreatedAdminsMailTest.php +++ b/tests/Feature/Mails/OrderCreatedAdminsMailTest.php @@ -3,12 +3,12 @@ namespace Happypixels\Shopr\Tests\Feature\Mails; use Happypixels\Shopr\Cart\Cart; -use Illuminate\Support\Facades\Mail; -use Happypixels\Shopr\Tests\TestCase; -use Illuminate\Support\Facades\Event; use Happypixels\Shopr\Mails\OrderCreatedAdmins; -use Illuminate\Foundation\Testing\RefreshDatabase; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Support\Facades\Event; +use Illuminate\Support\Facades\Mail; class OrderCreatedAdminsMailTest extends TestCase { diff --git a/tests/Feature/Mails/OrderCreatedCustomerMailTest.php b/tests/Feature/Mails/OrderCreatedCustomerMailTest.php index d04dc2f..c8e3c82 100644 --- a/tests/Feature/Mails/OrderCreatedCustomerMailTest.php +++ b/tests/Feature/Mails/OrderCreatedCustomerMailTest.php @@ -3,11 +3,11 @@ namespace Happypixels\Shopr\Tests\Feature\Mails; use Happypixels\Shopr\Cart\Cart; -use Illuminate\Support\Facades\Mail; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Mails\OrderCreatedCustomer; -use Illuminate\Foundation\Testing\RefreshDatabase; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Support\Facades\Mail; class OrderCreatedCustomerMailTest extends TestCase { diff --git a/tests/Feature/Money/PriceFormattingTest.php b/tests/Feature/Money/PriceFormattingTest.php index f917076..1d3158d 100644 --- a/tests/Feature/Money/PriceFormattingTest.php +++ b/tests/Feature/Money/PriceFormattingTest.php @@ -4,8 +4,8 @@ use Happypixels\Shopr\Cart\Cart; use Happypixels\Shopr\Models\Order; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; class PriceFormattingTest extends TestCase { diff --git a/tests/REST/Checkout/ChargeHttpTest.php b/tests/REST/Checkout/ChargeHttpTest.php index bc0bf8d..1a735f8 100644 --- a/tests/REST/Checkout/ChargeHttpTest.php +++ b/tests/REST/Checkout/ChargeHttpTest.php @@ -2,14 +2,14 @@ namespace Happypixels\Shopr\Tests\REST\Checkout; +use Happypixels\Shopr\Exceptions\PaymentFailedException; use Happypixels\Shopr\Models\Order; -use Happypixels\Shopr\Tests\TestCase; -use Illuminate\Support\Facades\Event; use Happypixels\Shopr\PaymentProviders\Stripe; -use Illuminate\Foundation\Testing\RefreshDatabase; -use Happypixels\Shopr\Exceptions\PaymentFailedException; use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; use Happypixels\Shopr\Tests\Support\Traits\InteractsWithPaymentProviders; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Support\Facades\Event; class ChargeHttpTest extends TestCase { diff --git a/tests/REST/Discounts/AddDiscountHttpTest.php b/tests/REST/Discounts/AddDiscountHttpTest.php index 7e5c284..6e0b500 100644 --- a/tests/REST/Discounts/AddDiscountHttpTest.php +++ b/tests/REST/Discounts/AddDiscountHttpTest.php @@ -3,9 +3,9 @@ namespace Happypixels\Shopr\Tests\REST\Discounts; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; +use Happypixels\Shopr\Tests\TestCase; class AddDiscountHttpTest extends TestCase { diff --git a/tests/REST/Discounts/AddDiscountValidationHttpTest.php b/tests/REST/Discounts/AddDiscountValidationHttpTest.php index 83e4edd..672029a 100644 --- a/tests/REST/Discounts/AddDiscountValidationHttpTest.php +++ b/tests/REST/Discounts/AddDiscountValidationHttpTest.php @@ -3,10 +3,10 @@ namespace Happypixels\Shopr\Tests\REST\Discounts; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Tests\Support\Rules\DiscountTestRule; use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; +use Happypixels\Shopr\Tests\TestCase; class AddDiscountValidationHttpTest extends TestCase { diff --git a/tests/TestCase.php b/tests/TestCase.php index 7a83d90..c1e573b 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,10 +2,10 @@ namespace Happypixels\Shopr\Tests; -use Mockery; +use Happypixels\Shopr\Tests\Support\Models\TestShoppable; use Illuminate\Database\Schema\Blueprint; +use Mockery; use Orchestra\Testbench\TestCase as Orchestra; -use Happypixels\Shopr\Tests\Support\Models\TestShoppable; class TestCase extends Orchestra { diff --git a/tests/Unit/Cart/AddCartItemUnitTest.php b/tests/Unit/Cart/AddCartItemUnitTest.php index 586dc6d..48efb05 100644 --- a/tests/Unit/Cart/AddCartItemUnitTest.php +++ b/tests/Unit/Cart/AddCartItemUnitTest.php @@ -4,11 +4,11 @@ use Happypixels\Shopr\Cart\Cart; use Happypixels\Shopr\Cart\CartItem; -use Happypixels\Shopr\Tests\TestCase; -use Illuminate\Support\Facades\Event; use Happypixels\Shopr\Models\DiscountCoupon; -use Illuminate\Database\Eloquent\ModelNotFoundException; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Database\Eloquent\ModelNotFoundException; +use Illuminate\Support\Facades\Event; class AddCartItemUnitTest extends TestCase { diff --git a/tests/Unit/Cart/AddDiscountCouponUnitTest.php b/tests/Unit/Cart/AddDiscountCouponUnitTest.php index 22dc2fc..09aa9f5 100644 --- a/tests/Unit/Cart/AddDiscountCouponUnitTest.php +++ b/tests/Unit/Cart/AddDiscountCouponUnitTest.php @@ -3,10 +3,10 @@ namespace Happypixels\Shopr\Tests\Unit\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; -use Illuminate\Support\Facades\Event; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Support\Facades\Event; class AddDiscountCouponUnitTest extends TestCase { diff --git a/tests/Unit/Cart/CartItemUnitTest.php b/tests/Unit/Cart/CartItemUnitTest.php index a792992..3483be4 100644 --- a/tests/Unit/Cart/CartItemUnitTest.php +++ b/tests/Unit/Cart/CartItemUnitTest.php @@ -3,8 +3,8 @@ namespace Happypixels\Shopr\Tests\Unit\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; class CartItemUnitTest extends TestCase { diff --git a/tests/Unit/Cart/CartSubItemUnitTest.php b/tests/Unit/Cart/CartSubItemUnitTest.php index 7c51aca..c2596d3 100644 --- a/tests/Unit/Cart/CartSubItemUnitTest.php +++ b/tests/Unit/Cart/CartSubItemUnitTest.php @@ -3,8 +3,8 @@ namespace Happypixels\Shopr\Tests\Unit\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; class CartSubItemUnitTest extends TestCase { diff --git a/tests/Unit/Cart/CartUnitTest.php b/tests/Unit/Cart/CartUnitTest.php index 92574d0..389b888 100644 --- a/tests/Unit/Cart/CartUnitTest.php +++ b/tests/Unit/Cart/CartUnitTest.php @@ -3,9 +3,9 @@ namespace Happypixels\Shopr\Tests\Unit\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; class CartUnitTest extends TestCase { diff --git a/tests/Unit/Cart/ConvertCartToOrderUnitTest.php b/tests/Unit/Cart/ConvertCartToOrderUnitTest.php index 94a90d2..1644513 100644 --- a/tests/Unit/Cart/ConvertCartToOrderUnitTest.php +++ b/tests/Unit/Cart/ConvertCartToOrderUnitTest.php @@ -3,12 +3,12 @@ namespace Happypixels\Shopr\Tests\Unit\Cart; use Happypixels\Shopr\Cart\Cart; +use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Models\Order; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\OrderItem; -use Happypixels\Shopr\Models\DiscountCoupon; -use Illuminate\Foundation\Testing\RefreshDatabase; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; class ConvertCartToOrderUnitTest extends TestCase { diff --git a/tests/Unit/Cart/HasDiscountCouponUnitTest.php b/tests/Unit/Cart/HasDiscountCouponUnitTest.php index e9754bf..0e42323 100644 --- a/tests/Unit/Cart/HasDiscountCouponUnitTest.php +++ b/tests/Unit/Cart/HasDiscountCouponUnitTest.php @@ -3,9 +3,9 @@ namespace Happypixels\Shopr\Tests\Unit\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; class HasDiscountCouponUnitTest extends TestCase { diff --git a/tests/Unit/Money/FormatterUnitTest.php b/tests/Unit/Money/FormatterUnitTest.php index 6843ebe..97d7747 100644 --- a/tests/Unit/Money/FormatterUnitTest.php +++ b/tests/Unit/Money/FormatterUnitTest.php @@ -2,8 +2,8 @@ namespace Happypixels\Shopr\Tests\Unit\Money; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Money\Formatter; +use Happypixels\Shopr\Tests\TestCase; class FormatterUnitTest extends TestCase { diff --git a/tests/Unit/Rules/Cart/CartNotEmptyRuleTest.php b/tests/Unit/Rules/Cart/CartNotEmptyRuleTest.php index 7088025..ab0ce4b 100644 --- a/tests/Unit/Rules/Cart/CartNotEmptyRuleTest.php +++ b/tests/Unit/Rules/Cart/CartNotEmptyRuleTest.php @@ -3,9 +3,9 @@ namespace Happypixels\Shopr\Tests\Unit\Rules\Cart; use Happypixels\Shopr\Cart\Cart; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Rules\Cart\CartNotEmpty; use Happypixels\Shopr\Tests\Support\Models\TestShoppable; +use Happypixels\Shopr\Tests\TestCase; class CartNotEmptyRuleTest extends TestCase { diff --git a/tests/Unit/Rules/Discounts/CartValueAboveCouponLimitRuleTest.php b/tests/Unit/Rules/Discounts/CartValueAboveCouponLimitRuleTest.php index 62337c4..b90ada5 100644 --- a/tests/Unit/Rules/Discounts/CartValueAboveCouponLimitRuleTest.php +++ b/tests/Unit/Rules/Discounts/CartValueAboveCouponLimitRuleTest.php @@ -2,10 +2,10 @@ namespace Happypixels\Shopr\Tests\Unit\Rules\Discounts; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; -use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; use Happypixels\Shopr\Rules\Discounts\CartValueAboveCouponLimit; +use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; +use Happypixels\Shopr\Tests\TestCase; class CartValueAboveCouponLimitRuleTest extends TestCase { diff --git a/tests/Unit/Rules/Discounts/CouponExistsRuleTest.php b/tests/Unit/Rules/Discounts/CouponExistsRuleTest.php index 922988b..79fade1 100644 --- a/tests/Unit/Rules/Discounts/CouponExistsRuleTest.php +++ b/tests/Unit/Rules/Discounts/CouponExistsRuleTest.php @@ -2,9 +2,9 @@ namespace Happypixels\Shopr\Tests\Unit\Rules\Discounts; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Rules\Discounts\CouponExists; +use Happypixels\Shopr\Tests\TestCase; class CouponExistsRuleTest extends TestCase { diff --git a/tests/Unit/Rules/Discounts/CouponHasNotBeenAppliedRuleTest.php b/tests/Unit/Rules/Discounts/CouponHasNotBeenAppliedRuleTest.php index f20cb2f..6afbbcd 100644 --- a/tests/Unit/Rules/Discounts/CouponHasNotBeenAppliedRuleTest.php +++ b/tests/Unit/Rules/Discounts/CouponHasNotBeenAppliedRuleTest.php @@ -2,9 +2,9 @@ namespace Happypixels\Shopr\Tests\Unit\Rules\Discounts; -use Happypixels\Shopr\Tests\TestCase; -use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; use Happypixels\Shopr\Rules\Discounts\CouponHasNotBeenApplied; +use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; +use Happypixels\Shopr\Tests\TestCase; class CouponHasNotBeenAppliedRuleTest extends TestCase { diff --git a/tests/Unit/Rules/Discounts/DateIsWithinCouponTimespanRuleTest.php b/tests/Unit/Rules/Discounts/DateIsWithinCouponTimespanRuleTest.php index aa2071d..a9c6532 100644 --- a/tests/Unit/Rules/Discounts/DateIsWithinCouponTimespanRuleTest.php +++ b/tests/Unit/Rules/Discounts/DateIsWithinCouponTimespanRuleTest.php @@ -2,9 +2,9 @@ namespace Happypixels\Shopr\Tests\Unit\Rules\Discounts; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Models\DiscountCoupon; use Happypixels\Shopr\Rules\Discounts\DateIsWithinCouponTimespan; +use Happypixels\Shopr\Tests\TestCase; class DateIsWithinCouponTimespanRuleTest extends TestCase { diff --git a/tests/Unit/Rules/Discounts/OnlyOneCouponPerOrderRuleTest.php b/tests/Unit/Rules/Discounts/OnlyOneCouponPerOrderRuleTest.php index 69cff9d..123ac3c 100644 --- a/tests/Unit/Rules/Discounts/OnlyOneCouponPerOrderRuleTest.php +++ b/tests/Unit/Rules/Discounts/OnlyOneCouponPerOrderRuleTest.php @@ -2,9 +2,9 @@ namespace Happypixels\Shopr\Tests\Unit\Rules\Discounts; -use Happypixels\Shopr\Tests\TestCase; use Happypixels\Shopr\Rules\Discounts\OnlyOneCouponPerOrder; use Happypixels\Shopr\Tests\Support\Traits\InteractsWithCart; +use Happypixels\Shopr\Tests\TestCase; class OnlyOneCouponPerOrderRuleTest extends TestCase {