mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 13:51:44 +00:00
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:
@@ -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.
|
||||
|
||||
+3
-7
@@ -1,15 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
|
||||
>
|
||||
<source>
|
||||
<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">
|
||||
<source ignoreIndirectDeprecations="true">
|
||||
<include>
|
||||
<directory suffix=".php">./src</directory>
|
||||
</include>
|
||||
</source>
|
||||
<testsuites>
|
||||
<testsuites>
|
||||
<testsuite name="Laravel Cart Test Suite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user