From aaa3360d1f601dc6a4c2d9bb4febb8daa10ac63c Mon Sep 17 00:00:00 2001 From: Joel Male Date: Wed, 27 May 2026 19:50:09 +1000 Subject: [PATCH] chore: add test bootstrap, update phpunit config, and add Laravel 13 support to README - Add tests/bootstrap.php to suppress PHP 8.4 vendor deprecation notices (Mockery implicit-nullable) - Update phpunit.xml.dist to reference bootstrap, use PHPUnit 11.5 schema, and ignore indirect deprecations - Note Laravel 13 support in README --- README.md | 15 ++++++++------- phpunit.xml.dist | 10 +++------- tests/bootstrap.php | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 tests/bootstrap.php diff --git a/README.md b/README.md index 6d8867f..41a9245 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,12 @@ A Cart Implementation for Laravel. -Supported Laravel Versions: 10, 11, and 12. +Supported Laravel Versions: 10, 11, 12, and 13. For Laravel 9.0 and below, please use version [1.0](https://github.com/wearepixel/laravel-cart/releases/tag/1.0.12) ## Table of Contents + - [Getting Started](#-getting-started) - [Demo](#-deni) - [Documentation](#-documentation) @@ -27,6 +28,7 @@ ## Table of Contents - [License](#-license) ## 🚀 Getting Started + ### 🔥 Installing Install the package through [Composer](http://getcomposer.org/). @@ -107,7 +109,6 @@ #### Round Mode 'round_mode' => env('LARAVEL_CART_ROUND_MODE', 'down'), ``` - ### Basic Usage The cart has a default sessionKey that holds the cart data and stores it in the session, so you can have multiple carts for multiple users. @@ -168,8 +169,8 @@ #### Adding to the cart: **Cart::add()** [], // attributes [ [ - 'name' => '10% Off', - 'type' => 'discount', + 'name' => '10% Off', + 'type' => 'discount', 'value' => '-10%' ] ] // conditions @@ -199,7 +200,7 @@ #### Updating an item on a cart: **Cart::update()** ```php Cart::update( 456, # product id - [ + [ 'name' => 'New Item Name', // new item name 'price' => 98.67, // new item price as a float or string ] @@ -215,7 +216,7 @@ #### Updating an item on a cart: **Cart::update()** // reducing it... Cart::update( - 456, + 456, [ 'quantity' => -1, // so if from 4 to 3 ] @@ -841,4 +842,4 @@ ## 🫡 Credits ## 📓 License -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. \ No newline at end of file +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c77bb5e..ad38566 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,15 +1,11 @@ - - + + ./src - + tests diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..4aa9943 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,14 @@ +