diff --git a/.ecrc b/.ecrc index 0a2c1fd69..5d2c79686 100644 --- a/.ecrc +++ b/.ecrc @@ -15,7 +15,6 @@ "LICENSE$", "^temp\/", "^\\.idea\/", - "^.phpunit.result.cache$", "\\.DS_Store$", "\\.phar$" ], diff --git a/.gitignore b/.gitignore index 48ce82aae..84aef0efa 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ /log/ **/.DS_Store /tests-coverage/ -/.phpunit.result.cache /config/config.local.neon /node_modules/ phpunit.xml diff --git a/composer.json b/composer.json index 4e3ed6517..a879f28f5 100644 --- a/composer.json +++ b/composer.json @@ -5,18 +5,19 @@ "require-dev": { "composer/composer": "^2.6", "wpify/scoper": "3.2.13", - "phpunit/phpunit": "10.4.2", - "php-stubs/woocommerce-stubs": "^9.3", + "phpunit/phpunit": "^10.5", + "php-stubs/woocommerce-stubs": "^9.5", "editorconfig-checker/editorconfig-checker": "^10.6", "slevomat/coding-standard": "^8.15", "wp-cli/wp-cli-bundle": "^2.11", "phpstan/extension-installer": "^1.4", "szepeviktor/phpstan-wordpress": "^2.0", "phpstan/phpstan-strict-rules": "^2.0", - "phpstan/phpstan": "^2.0", + "phpstan/phpstan": "^2.1", "squizlabs/php_codesniffer": "^3.11", "woocommerce/woocommerce-sniffs": "^1.0", - "phpstan/phpstan-nette": "^2.0" + "phpstan/phpstan-nette": "^2.0", + "php-stubs/wordpress-stubs": "^6.7" }, "scripts": { "build:deps": "bash build-deps.sh", diff --git a/composer.lock b/composer.lock index ba9bfb5d8..9ff719dbb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0d4995016ad53db0a7a30a2c8d30db9e", + "content-hash": "9302f3568b8614472b81fd4f3e2baaee", "packages": [], "packages-dev": [ { @@ -1435,16 +1435,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v9.4.2", + "version": "v9.5.0", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "d4347943eac3af274089abf1af9449e9dab45a96" + "reference": "813f3cad9892bd3b6ffae9334a4ccaa73692b439" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/d4347943eac3af274089abf1af9449e9dab45a96", - "reference": "d4347943eac3af274089abf1af9449e9dab45a96", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/813f3cad9892bd3b6ffae9334a4ccaa73692b439", + "reference": "813f3cad9892bd3b6ffae9334a4ccaa73692b439", "shasum": "" }, "require": { @@ -1473,9 +1473,9 @@ ], "support": { "issues": "https://github.com/php-stubs/woocommerce-stubs/issues", - "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v9.4.2" + "source": "https://github.com/php-stubs/woocommerce-stubs/tree/v9.5.0" }, - "time": "2024-11-19T19:49:15+00:00" + "time": "2024-12-17T03:31:31+00:00" }, { "name": "php-stubs/wordpress-stubs", @@ -1992,16 +1992,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.0.3", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "46b4d3529b12178112d9008337beda0cc2a1a6b4" + "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/46b4d3529b12178112d9008337beda0cc2a1a6b4", - "reference": "46b4d3529b12178112d9008337beda0cc2a1a6b4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", + "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", "shasum": "" }, "require": { @@ -2046,7 +2046,7 @@ "type": "github" } ], - "time": "2024-11-28T22:19:37+00:00" + "time": "2025-01-05T16:43:48+00:00" }, { "name": "phpstan/phpstan-nette", @@ -2111,21 +2111,21 @@ }, { "name": "phpstan/phpstan-strict-rules", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "a4a6a08bd4a461e516b9c3b8fdbf0f1883b34158" + "reference": "ed6fea0ad4ad9c7e25f3ad2e7c4d420cf1e67fe3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/a4a6a08bd4a461e516b9c3b8fdbf0f1883b34158", - "reference": "a4a6a08bd4a461e516b9c3b8fdbf0f1883b34158", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/ed6fea0ad4ad9c7e25f3ad2e7c4d420cf1e67fe3", + "reference": "ed6fea0ad4ad9c7e25f3ad2e7c4d420cf1e67fe3", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.0" + "phpstan/phpstan": "^2.0.4" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -2153,9 +2153,9 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.0" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.1" }, - "time": "2024-10-26T16:04:33+00:00" + "time": "2024-12-12T20:21:10+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2480,16 +2480,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.4.2", + "version": "10.5.40", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1" + "reference": "e6ddda95af52f69c1e0c7b4f977cccb58048798c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", - "reference": "cacd8b9dd224efa8eb28beb69004126c7ca1a1a1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e6ddda95af52f69c1e0c7b4f977cccb58048798c", + "reference": "e6ddda95af52f69c1e0c7b4f977cccb58048798c", "shasum": "" }, "require": { @@ -2499,26 +2499,26 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.1.5", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-invoker": "^4.0", - "phpunit/php-text-template": "^3.0", - "phpunit/php-timer": "^6.0", - "sebastian/cli-parser": "^2.0", - "sebastian/code-unit": "^2.0", - "sebastian/comparator": "^5.0", - "sebastian/diff": "^5.0", - "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.1", - "sebastian/global-state": "^6.0.1", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.3", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.2", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.0", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -2529,7 +2529,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.4-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -2561,7 +2561,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.2" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.40" }, "funding": [ { @@ -2577,7 +2577,7 @@ "type": "tidelift" } ], - "time": "2023-10-26T07:21:45+00:00" + "time": "2024-12-21T05:49:06+00:00" }, { "name": "psr/container", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7354181b1..ea86190a9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,14 @@ - + diff --git a/tests/Module/Checkout/RateCalculatorTest.php b/tests/Module/Checkout/RateCalculatorTest.php index 23bb02df6..58eacae94 100644 --- a/tests/Module/Checkout/RateCalculatorTest.php +++ b/tests/Module/Checkout/RateCalculatorTest.php @@ -137,14 +137,14 @@ public static function calculationDataProvider(): array { /** * @dataProvider calculationDataProvider */ - public function testGetShippingRateCost( ?float $expectedCost, Options $carrierOptions, float $totalProductValue, float $cartWeight, bool $isCouponApplied ): void { + public function testGetShippingRateCost( ?float $expectedCost, Options $carrierOptions, float $totalProductValue, float $cartWeightKg, bool $isCouponApplied ): void { $this->createRateCalculatorMock(); $cost = $this->rateCalculator->getShippingRateCost( $carrierOptions, $totalProductValue, $totalProductValue, - $cartWeight, + $cartWeightKg, $isCouponApplied ); diff --git a/tests/Module/Checkout/ShippingRateFactoryTest.php b/tests/Module/Checkout/ShippingRateFactoryTest.php index 444052654..439181151 100644 --- a/tests/Module/Checkout/ShippingRateFactoryTest.php +++ b/tests/Module/Checkout/ShippingRateFactoryTest.php @@ -116,7 +116,7 @@ public static function rateCreationDataProvider(): array { ], 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 5.0, + 'cartWeightKg' => 5.0, ], 'car delivery carrier must not be present in rates' => [ @@ -162,7 +162,7 @@ public static function rateCreationDataProvider(): array { 'allowedCarrierNames' => null, 'isCarDeliveryEnabled' => false, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], 'only one carrier is active' => [ @@ -208,7 +208,7 @@ public static function rateCreationDataProvider(): array { 'allowedCarrierNames' => null, 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], 'carrier not supporting over-weight cart must be omitted' => [ @@ -242,7 +242,7 @@ public static function rateCreationDataProvider(): array { ], 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 21.0, + 'cartWeightKg' => 21.0, ], 'inactive carrier must be omitted' => [ @@ -273,7 +273,7 @@ public static function rateCreationDataProvider(): array { 'allowedCarrierNames' => [], 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], 'carrier disallowed by product must be omitted' => [ @@ -302,7 +302,7 @@ public static function rateCreationDataProvider(): array { ], 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], 'carrier disallowed by product category must be omitted' => [ @@ -331,7 +331,7 @@ public static function rateCreationDataProvider(): array { ], 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], 'car delivery carriers must be supported' => [ @@ -365,7 +365,7 @@ public static function rateCreationDataProvider(): array { ], 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], 'carrier not supporting age verification must be omitted' => [ @@ -399,7 +399,7 @@ public static function rateCreationDataProvider(): array { ], 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => true, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], 'allowed carrier names argument must support null' => [ @@ -430,7 +430,7 @@ public static function rateCreationDataProvider(): array { 'allowedCarrierNames' => null, 'isCarDeliveryEnabled' => true, 'isAgeVerificationRequiredByProduct' => false, - 'cartWeight' => 1.0, + 'cartWeightKg' => 1.0, ], ]; }