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
This commit is contained in:
Joel Male
2026-05-27 19:50:09 +10:00
parent 05729b7865
commit aaa3360d1f
3 changed files with 25 additions and 14 deletions
+3 -2
View File
@@ -9,11 +9,12 @@
A Cart Implementation for Laravel. 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) 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 ## Table of Contents
- [Getting Started](#-getting-started) - [Getting Started](#-getting-started)
- [Demo](#-deni) - [Demo](#-deni)
- [Documentation](#-documentation) - [Documentation](#-documentation)
@@ -27,6 +28,7 @@ ## Table of Contents
- [License](#-license) - [License](#-license)
## 🚀 Getting Started ## 🚀 Getting Started
### 🔥 Installing ### 🔥 Installing
Install the package through [Composer](http://getcomposer.org/). Install the package through [Composer](http://getcomposer.org/).
@@ -107,7 +109,6 @@ #### Round Mode
'round_mode' => env('LARAVEL_CART_ROUND_MODE', 'down'), 'round_mode' => env('LARAVEL_CART_ROUND_MODE', 'down'),
``` ```
### Basic Usage ### 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. 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.
+2 -6
View File
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd">
bootstrap="vendor/autoload.php" <source ignoreIndirectDeprecations="true">
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
>
<source>
<include> <include>
<directory suffix=".php">./src</directory> <directory suffix=".php">./src</directory>
</include> </include>
+14
View File
@@ -0,0 +1,14 @@
<?php
require __DIR__ . '/../vendor/autoload.php';
// Suppress PHP 8.4 deprecation notices that originate from vendor code.
// These are typically from third-party packages (e.g. Mockery) that have not
// yet updated implicit-nullable parameter signatures and are not actionable here.
set_error_handler(static function (int $errno, string $errstr, string $errfile): bool {
if ($errno === E_DEPRECATED && str_contains($errfile, DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR)) {
return true;
}
return false;
}, E_DEPRECATED);