Skip to content

Commit b26d200

Browse files
committed
Merge branch 'release/3.1.0'
2 parents 27ba394 + ce544aa commit b26d200

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"require": {
2424
"php": "^8.1",
2525
"ext-json": "*",
26-
"cknow/laravel-money": "^6.2",
26+
"cknow/laravel-money": "^6.2 || ^7.1",
2727
"commerceguys/addressing": "^1.0",
2828
"commerceguys/tax": "^0.8",
2929
"florianv/laravel-swap": "^2.3",
3030
"iben12/laravel-statable": "^1.4",
31-
"illuminate/database": "^9.0",
31+
"illuminate/database": "^9.0 || ^10.0",
3232
"mpociot/vat-calculator": "^3.0",
3333
"nyholm/psr7": "^1.3",
3434
"php-http/curl-client": "^2.1",
@@ -37,8 +37,8 @@
3737
},
3838
"require-dev": {
3939
"friendsofphp/php-cs-fixer": "^3.7",
40-
"orchestra/testbench": "^7.1",
41-
"phpunit/phpunit": "^9.1"
40+
"orchestra/testbench": "^7.1 || ^8.0",
41+
"phpunit/phpunit": "^9.1 || ^10.0"
4242
},
4343
"autoload": {
4444
"files": [
@@ -59,7 +59,10 @@
5959
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
6060
},
6161
"config": {
62-
"sort-packages": true
62+
"sort-packages": true,
63+
"allow-plugins": {
64+
"php-http/discovery": true
65+
}
6366
},
6467
"extra": {
6568
"laravel": {

phpunit.xml.dist

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false"
3-
backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true"
4-
convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false"
5-
stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
6-
<coverage>
7-
<include>
8-
<directory suffix=".php">src/</directory>
9-
</include>
10-
<report>
11-
<clover outputFile="build/logs/clover.xml"/>
12-
<html outputDirectory="build/coverage"/>
13-
<text outputFile="build/coverage.txt"/>
14-
</report>
15-
</coverage>
16-
<testsuites>
17-
<testsuite name="Test Suite">
18-
<directory>tests</directory>
19-
</testsuite>
20-
</testsuites>
21-
<logging>
22-
<junit outputFile="build/report.junit.xml"/>
23-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">src/</directory>
6+
</include>
7+
<report>
8+
<clover outputFile="build/logs/clover.xml"/>
9+
<html outputDirectory="build/coverage"/>
10+
<text outputFile="build/coverage.txt"/>
11+
</report>
12+
</coverage>
13+
<testsuites>
14+
<testsuite name="Test Suite">
15+
<directory>tests</directory>
16+
</testsuite>
17+
</testsuites>
18+
<logging>
19+
<junit outputFile="build/report.junit.xml"/>
20+
</logging>
2421
</phpunit>

src/Discount/Discount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class Discount extends DataTransferObject implements Arrayable, Jsonable
2020

2121
public function __construct(array $parameters = [])
2222
{
23-
$this->attributes = collect([]);
2423
$parameters['id'] ??= sha1((string)Str::orderedUuid());
24+
$parameters['attributes'] ??= Collection::make([]);
2525

2626
parent::__construct($parameters);
2727
}

tests/Tax/TaxTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public function can_calculate_tax_for_physical_product()
4747
$amounts = app()->make(TaxResolver::class)->resolveAmounts($product, $context);
4848
$tax = $amounts[0]->getAmount();
4949

50-
$tax = money($tax * 100);
51-
$this->assertTrue(money(22)->equals($tax));
50+
$tax = money((string) $tax);
51+
$this->assertTrue(money(22, $tax->getCurrency())->equals($tax),);
5252
}
5353

5454
/** @test */

0 commit comments

Comments
 (0)