diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6672db67..6dfa93ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# 3.x branch
## 3.0 branch
+### 3.0.1
+* Fixed a serious bug in the `BackupExport::compression()` method, which did not correctly reset the filename to use. Extended testing.
+
### 3.0.0
* `BackupExport` and `BackupImport` now make extensive use of property hooks (instead of methods), which has allowed for significant code optimization.
Thanks to the magic `__call()` method provided by `Utility`, they still support the use of already known methods (`filename()`, `compression()`, `timeout()`) to set properties;
diff --git a/composer.lock b/composer.lock
index 20c06572..92f75aea 100644
--- a/composer.lock
+++ b/composer.lock
@@ -8,16 +8,16 @@
"packages": [
{
"name": "cakephp/cakephp",
- "version": "5.2.7",
+ "version": "5.2.9",
"source": {
"type": "git",
"url": "https://github.com/cakephp/cakephp.git",
- "reference": "6912570c76b7c27410ab7524d119e5a97f851508"
+ "reference": "12d41e43f945c1cb38ef3d983a9d87f9b13c041f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cakephp/cakephp/zipball/6912570c76b7c27410ab7524d119e5a97f851508",
- "reference": "6912570c76b7c27410ab7524d119e5a97f851508",
+ "url": "https://api.github.com/repos/cakephp/cakephp/zipball/12d41e43f945c1cb38ef3d983a9d87f9b13c041f",
+ "reference": "12d41e43f945c1cb38ef3d983a9d87f9b13c041f",
"shasum": ""
},
"require": {
@@ -65,7 +65,7 @@
"cakephp/validation": "self.version"
},
"require-dev": {
- "cakephp/cakephp-codesniffer": "^5.2",
+ "cakephp/cakephp-codesniffer": "^5.3",
"http-interop/http-factory-tests": "dev-main",
"mikey179/vfsstream": "^1.6.10",
"mockery/mockery": "^1.6",
@@ -125,7 +125,7 @@
"issues": "https://github.com/cakephp/cakephp/issues",
"source": "https://github.com/cakephp/cakephp"
},
- "time": "2025-08-31T02:18:16+00:00"
+ "time": "2025-10-17T03:14:02+00:00"
},
{
"name": "cakephp/chronos",
@@ -260,20 +260,20 @@
},
{
"name": "laminas/laminas-diactoros",
- "version": "3.6.0",
+ "version": "3.8.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-diactoros.git",
- "reference": "b068eac123f21c0e592de41deeb7403b88e0a89f"
+ "reference": "60c182916b2749480895601649563970f3f12ec4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/b068eac123f21c0e592de41deeb7403b88e0a89f",
- "reference": "b068eac123f21c0e592de41deeb7403b88e0a89f",
+ "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/60c182916b2749480895601649563970f3f12ec4",
+ "reference": "60c182916b2749480895601649563970f3f12ec4",
"shasum": ""
},
"require": {
- "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
+ "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"psr/http-factory": "^1.1",
"psr/http-message": "^1.1 || ^2.0"
},
@@ -290,11 +290,11 @@
"ext-gd": "*",
"ext-libxml": "*",
"http-interop/http-factory-tests": "^2.2.0",
- "laminas/laminas-coding-standard": "~3.0.0",
+ "laminas/laminas-coding-standard": "~3.1.0",
"php-http/psr7-integration-tests": "^1.4.0",
"phpunit/phpunit": "^10.5.36",
- "psalm/plugin-phpunit": "^0.19.0",
- "vimeo/psalm": "^5.26.1"
+ "psalm/plugin-phpunit": "^0.19.5",
+ "vimeo/psalm": "^6.13"
},
"type": "library",
"extra": {
@@ -344,24 +344,24 @@
"type": "community_bridge"
}
],
- "time": "2025-05-05T16:03:34+00:00"
+ "time": "2025-10-12T15:31:36+00:00"
},
{
"name": "laminas/laminas-httphandlerrunner",
- "version": "2.12.0",
+ "version": "2.13.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-httphandlerrunner.git",
- "reference": "b14da3519c650e9436e410cfedee6f860312eff9"
+ "reference": "181eaeeb838ad3d80fbbcfb0657a46bc212bbd4e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/b14da3519c650e9436e410cfedee6f860312eff9",
- "reference": "b14da3519c650e9436e410cfedee6f860312eff9",
+ "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/181eaeeb838ad3d80fbbcfb0657a46bc212bbd4e",
+ "reference": "181eaeeb838ad3d80fbbcfb0657a46bc212bbd4e",
"shasum": ""
},
"require": {
- "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
+ "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/http-message-implementation": "^1.0 || ^2.0",
"psr/http-server-handler": "^1.0"
@@ -411,7 +411,7 @@
"type": "community_bridge"
}
],
- "time": "2025-05-13T21:21:16+00:00"
+ "time": "2025-10-12T20:58:29+00:00"
},
{
"name": "league/container",
@@ -1210,16 +1210,16 @@
},
{
"name": "symfony/process",
- "version": "v7.3.3",
+ "version": "v7.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "32241012d521e2e8a9d713adb0812bb773b907f1"
+ "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/32241012d521e2e8a9d713adb0812bb773b907f1",
- "reference": "32241012d521e2e8a9d713adb0812bb773b907f1",
+ "url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b",
+ "reference": "f24f8f316367b30810810d4eb30c543d7003ff3b",
"shasum": ""
},
"require": {
@@ -1251,7 +1251,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/process/tree/v7.3.3"
+ "source": "https://github.com/symfony/process/tree/v7.3.4"
},
"funding": [
{
@@ -1271,35 +1271,35 @@
"type": "tidelift"
}
],
- "time": "2025-08-18T09:42:54+00:00"
+ "time": "2025-09-11T10:12:26+00:00"
}
],
"packages-dev": [
{
"name": "cakedc/cakephp-phpstan",
- "version": "4.0.0",
+ "version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/CakeDC/cakephp-phpstan.git",
- "reference": "dec811f201ae971503848bc6190ce42a9b41efa5"
+ "reference": "a96c5f2808cdf47de617a7174203493bdffd2772"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/CakeDC/cakephp-phpstan/zipball/dec811f201ae971503848bc6190ce42a9b41efa5",
- "reference": "dec811f201ae971503848bc6190ce42a9b41efa5",
+ "url": "https://api.github.com/repos/CakeDC/cakephp-phpstan/zipball/a96c5f2808cdf47de617a7174203493bdffd2772",
+ "reference": "a96c5f2808cdf47de617a7174203493bdffd2772",
"shasum": ""
},
"require": {
"cakephp/cakephp": "^5.0",
"php": ">=8.1.0",
- "phpstan/phpstan": "^2.0"
+ "phpstan/phpstan": "^2.1.26"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^5.0",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
- "phpunit/phpunit": "^10.1"
+ "phpunit/phpunit": "^10.5 || ^11.5 || ^12.1"
},
"type": "phpstan-extension",
"extra": {
@@ -1328,9 +1328,9 @@
"description": "CakePHP plugin extension for PHPStan.",
"support": {
"issues": "https://github.com/CakeDC/cakephp-phpstan/issues",
- "source": "https://github.com/CakeDC/cakephp-phpstan/tree/4.0.0"
+ "source": "https://github.com/CakeDC/cakephp-phpstan/tree/4.1.0"
},
- "time": "2024-11-11T15:58:58+00:00"
+ "time": "2025-10-12T13:48:52+00:00"
},
{
"name": "cakephp/cakephp-codesniffer",
@@ -1388,27 +1388,28 @@
},
{
"name": "cakephp/migrations",
- "version": "4.7.2",
+ "version": "4.8.2",
"source": {
"type": "git",
"url": "https://github.com/cakephp/migrations.git",
- "reference": "69732d98d84b99f9b0a8af94de7dd9ac242aeaff"
+ "reference": "efe451ad8d8a510bba97d9720bfdc63c06d6da98"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/cakephp/migrations/zipball/69732d98d84b99f9b0a8af94de7dd9ac242aeaff",
- "reference": "69732d98d84b99f9b0a8af94de7dd9ac242aeaff",
+ "url": "https://api.github.com/repos/cakephp/migrations/zipball/efe451ad8d8a510bba97d9720bfdc63c06d6da98",
+ "reference": "efe451ad8d8a510bba97d9720bfdc63c06d6da98",
"shasum": ""
},
"require": {
- "cakephp/cache": "^5.2",
- "cakephp/orm": "^5.2",
+ "cakephp/cache": "^5.2.9",
+ "cakephp/database": "^5.2.9",
+ "cakephp/orm": "^5.2.9",
"php": ">=8.1",
"robmorgan/phinx": "^0.16.10"
},
"require-dev": {
"cakephp/bake": "^3.3",
- "cakephp/cakephp": "^5.2.5",
+ "cakephp/cakephp": "^5.2.9",
"cakephp/cakephp-codesniffer": "^5.0",
"phpunit/phpunit": "^10.5.5 || ^11.1.3 || ^12.2.4"
},
@@ -1445,7 +1446,7 @@
"issues": "https://github.com/cakephp/migrations/issues",
"source": "https://github.com/cakephp/migrations"
},
- "time": "2025-09-01T04:46:50+00:00"
+ "time": "2025-10-19T15:16:42+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
@@ -1739,16 +1740,16 @@
},
{
"name": "nikic/php-parser",
- "version": "v5.6.1",
+ "version": "v5.6.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2"
+ "reference": "3a454ca033b9e06b63282ce19562e892747449bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2",
- "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3a454ca033b9e06b63282ce19562e892747449bb",
+ "reference": "3a454ca033b9e06b63282ce19562e892747449bb",
"shasum": ""
},
"require": {
@@ -1791,9 +1792,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.1"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.2"
},
- "time": "2025-08-13T20:13:15+00:00"
+ "time": "2025-10-21T19:32:17+00:00"
},
{
"name": "phar-io/manifest",
@@ -1962,16 +1963,11 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.1.28",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpstan.git",
- "reference": "578fa296a166605d97b94091f724f1257185d278"
- },
+ "version": "2.1.31",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/578fa296a166605d97b94091f724f1257185d278",
- "reference": "578fa296a166605d97b94091f724f1257185d278",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ead89849d879fe203ce9292c6ef5e7e76f867b96",
+ "reference": "ead89849d879fe203ce9292c6ef5e7e76f867b96",
"shasum": ""
},
"require": {
@@ -2016,20 +2012,20 @@
"type": "github"
}
],
- "time": "2025-09-19T08:58:49+00:00"
+ "time": "2025-10-10T14:14:11+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "12.3.8",
+ "version": "12.4.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "99e692c6a84708211f7536ba322bbbaef57ac7fc"
+ "reference": "67e8aed88f93d0e6e1cb7effe1a2dfc2fee6022c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/99e692c6a84708211f7536ba322bbbaef57ac7fc",
- "reference": "99e692c6a84708211f7536ba322bbbaef57ac7fc",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/67e8aed88f93d0e6e1cb7effe1a2dfc2fee6022c",
+ "reference": "67e8aed88f93d0e6e1cb7effe1a2dfc2fee6022c",
"shasum": ""
},
"require": {
@@ -2056,7 +2052,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "12.3.x-dev"
+ "dev-main": "12.4.x-dev"
}
},
"autoload": {
@@ -2085,7 +2081,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.3.8"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.4.0"
},
"funding": [
{
@@ -2105,7 +2101,7 @@
"type": "tidelift"
}
],
- "time": "2025-09-17T11:31:43+00:00"
+ "time": "2025-09-24T13:44:41+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -2354,16 +2350,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "12.3.13",
+ "version": "12.4.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "44f15312c4968fa8102e491fc6f3746410819c16"
+ "reference": "fc5413a2e6d240d2f6d9317bdf7f0a24e73de194"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/44f15312c4968fa8102e491fc6f3746410819c16",
- "reference": "44f15312c4968fa8102e491fc6f3746410819c16",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc5413a2e6d240d2f6d9317bdf7f0a24e73de194",
+ "reference": "fc5413a2e6d240d2f6d9317bdf7f0a24e73de194",
"shasum": ""
},
"require": {
@@ -2377,7 +2373,7 @@
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
"php": ">=8.3",
- "phpunit/php-code-coverage": "^12.3.8",
+ "phpunit/php-code-coverage": "^12.4.0",
"phpunit/php-file-iterator": "^6.0.0",
"phpunit/php-invoker": "^6.0.0",
"phpunit/php-text-template": "^5.0.0",
@@ -2386,7 +2382,7 @@
"sebastian/comparator": "^7.1.3",
"sebastian/diff": "^7.0.0",
"sebastian/environment": "^8.0.3",
- "sebastian/exporter": "^7.0.1",
+ "sebastian/exporter": "^7.0.2",
"sebastian/global-state": "^8.0.2",
"sebastian/object-enumerator": "^7.0.0",
"sebastian/type": "^6.0.3",
@@ -2399,7 +2395,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "12.3-dev"
+ "dev-main": "12.4-dev"
}
},
"autoload": {
@@ -2431,7 +2427,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.13"
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/12.4.1"
},
"funding": [
{
@@ -2455,7 +2451,7 @@
"type": "tidelift"
}
],
- "time": "2025-09-23T06:25:02+00:00"
+ "time": "2025-10-09T14:08:29+00:00"
},
{
"name": "robmorgan/phinx",
@@ -2908,16 +2904,16 @@
},
{
"name": "sebastian/exporter",
- "version": "7.0.1",
+ "version": "7.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "b759164a8e02263784b662889cc6cbb686077af6"
+ "reference": "016951ae10980765e4e7aee491eb288c64e505b7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/b759164a8e02263784b662889cc6cbb686077af6",
- "reference": "b759164a8e02263784b662889cc6cbb686077af6",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/016951ae10980765e4e7aee491eb288c64e505b7",
+ "reference": "016951ae10980765e4e7aee491eb288c64e505b7",
"shasum": ""
},
"require": {
@@ -2974,7 +2970,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"security": "https://github.com/sebastianbergmann/exporter/security/policy",
- "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.1"
+ "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.2"
},
"funding": [
{
@@ -2994,7 +2990,7 @@
"type": "tidelift"
}
],
- "time": "2025-09-22T05:39:29+00:00"
+ "time": "2025-09-24T06:16:11+00:00"
},
{
"name": "sebastian/global-state",
@@ -3443,16 +3439,16 @@
},
{
"name": "slevomat/coding-standard",
- "version": "8.23.0",
+ "version": "8.24.0",
"source": {
"type": "git",
"url": "https://github.com/slevomat/coding-standard.git",
- "reference": "ba476e9c5dd52107acb17e33a70034d65f380847"
+ "reference": "08e7989c0351f3f38b82172838195c35d9819efa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/ba476e9c5dd52107acb17e33a70034d65f380847",
- "reference": "ba476e9c5dd52107acb17e33a70034d65f380847",
+ "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/08e7989c0351f3f38b82172838195c35d9819efa",
+ "reference": "08e7989c0351f3f38b82172838195c35d9819efa",
"shasum": ""
},
"require": {
@@ -3464,11 +3460,11 @@
"require-dev": {
"phing/phing": "3.0.1|3.1.0",
"php-parallel-lint/php-parallel-lint": "1.4.0",
- "phpstan/phpstan": "2.1.26",
+ "phpstan/phpstan": "2.1.29",
"phpstan/phpstan-deprecation-rules": "2.0.3",
"phpstan/phpstan-phpunit": "2.0.7",
"phpstan/phpstan-strict-rules": "2.0.6",
- "phpunit/phpunit": "9.6.8|10.5.48|11.4.4|11.5.36|12.3.11"
+ "phpunit/phpunit": "9.6.8|10.5.48|11.4.4|11.5.36|12.3.14"
},
"type": "phpcodesniffer-standard",
"extra": {
@@ -3492,7 +3488,7 @@
],
"support": {
"issues": "https://github.com/slevomat/coding-standard/issues",
- "source": "https://github.com/slevomat/coding-standard/tree/8.23.0"
+ "source": "https://github.com/slevomat/coding-standard/tree/8.24.0"
},
"funding": [
{
@@ -3504,7 +3500,7 @@
"type": "tidelift"
}
],
- "time": "2025-09-17T09:18:54+00:00"
+ "time": "2025-09-25T21:37:40+00:00"
},
{
"name": "squizlabs/php_codesniffer",
@@ -3639,16 +3635,16 @@
},
{
"name": "symfony/config",
- "version": "v7.3.2",
+ "version": "v7.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "faef36e271bbeb74a9d733be4b56419b157762e2"
+ "reference": "8a09223170046d2cfda3d2e11af01df2c641e961"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/faef36e271bbeb74a9d733be4b56419b157762e2",
- "reference": "faef36e271bbeb74a9d733be4b56419b157762e2",
+ "url": "https://api.github.com/repos/symfony/config/zipball/8a09223170046d2cfda3d2e11af01df2c641e961",
+ "reference": "8a09223170046d2cfda3d2e11af01df2c641e961",
"shasum": ""
},
"require": {
@@ -3694,7 +3690,7 @@
"description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/config/tree/v7.3.2"
+ "source": "https://github.com/symfony/config/tree/v7.3.4"
},
"funding": [
{
@@ -3714,20 +3710,20 @@
"type": "tidelift"
}
],
- "time": "2025-07-26T13:55:06+00:00"
+ "time": "2025-09-22T12:46:16+00:00"
},
{
"name": "symfony/console",
- "version": "v7.3.3",
+ "version": "v7.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7"
+ "reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7",
- "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7",
+ "url": "https://api.github.com/repos/symfony/console/zipball/2b9c5fafbac0399a20a2e82429e2bd735dcfb7db",
+ "reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db",
"shasum": ""
},
"require": {
@@ -3792,7 +3788,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v7.3.3"
+ "source": "https://github.com/symfony/console/tree/v7.3.4"
},
"funding": [
{
@@ -3812,7 +3808,7 @@
"type": "tidelift"
}
],
- "time": "2025-08-25T06:35:40+00:00"
+ "time": "2025-09-22T15:31:00+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -4201,16 +4197,16 @@
},
{
"name": "symfony/string",
- "version": "v7.3.3",
+ "version": "v7.3.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c"
+ "reference": "f96476035142921000338bad71e5247fbc138872"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/17a426cce5fd1f0901fefa9b2a490d0038fd3c9c",
- "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c",
+ "url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872",
+ "reference": "f96476035142921000338bad71e5247fbc138872",
"shasum": ""
},
"require": {
@@ -4225,7 +4221,6 @@
},
"require-dev": {
"symfony/emoji": "^7.1",
- "symfony/error-handler": "^6.4|^7.0",
"symfony/http-client": "^6.4|^7.0",
"symfony/intl": "^6.4|^7.0",
"symfony/translation-contracts": "^2.5|^3.0",
@@ -4268,7 +4263,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v7.3.3"
+ "source": "https://github.com/symfony/string/tree/v7.3.4"
},
"funding": [
{
@@ -4288,7 +4283,7 @@
"type": "tidelift"
}
],
- "time": "2025-08-25T06:35:40+00:00"
+ "time": "2025-09-11T14:36:48+00:00"
},
{
"name": "theseer/tokenizer",
diff --git a/src/Utility/BackupExport.php b/src/Utility/BackupExport.php
index a46c81e7..9800e2db 100644
--- a/src/Utility/BackupExport.php
+++ b/src/Utility/BackupExport.php
@@ -106,7 +106,7 @@ public function __construct(ConnectionInterface|string $Connection = '')
public function export(): string|false
{
if (empty($this->filename)) {
- $this->filename = 'backup_{$DATABASE}_{$DATETIME}.sql';
+ $this->filename = 'backup_{$DATABASE}_{$DATETIME}.' . $this->compression->value;
}
//Dispatches the `Backup.beforeExport` event implemented by the `Executor` class
diff --git a/tests/TestCase/Command/ExportCommandTest.php b/tests/TestCase/Command/ExportCommandTest.php
index 287c6a91..561a5d26 100644
--- a/tests/TestCase/Command/ExportCommandTest.php
+++ b/tests/TestCase/Command/ExportCommandTest.php
@@ -16,7 +16,6 @@
namespace DatabaseBackup\Test\TestCase\Command;
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait;
-use Cake\Console\TestSuite\StubConsoleOutput;
use Cake\Core\Configure;
use DatabaseBackup\Command\ExportCommand;
use DatabaseBackup\TestSuite\TestCase;
@@ -36,6 +35,9 @@ class ExportCommandTest extends TestCase
{
use ConsoleIntegrationTestTrait;
+ /**
+ * @link \DatabaseBackup\Command\ExportCommand::buildOptionParser()
+ */
#[Test]
#[RequiresOperatingSystemFamily('Linux')]
public function testBuildOptionParser(): void
@@ -74,6 +76,9 @@ public function testBuildOptionParser(): void
$this->assertOutputContains($expected);
}
+ /**
+ * @link \DatabaseBackup\Command\ExportCommand::execute()
+ */
#[Test]
#[RunInSeparateProcess]
public function testExecute(): void
@@ -81,11 +86,20 @@ public function testExecute(): void
$expectedFilename = Configure::readOrFail('DatabaseBackup.target') . 'my_backup.sql';
$BackupExport = Mockery::mock('overload:' . BackupExport::class);
- $BackupExport->shouldReceive('__construct')->with('')->once();
- $BackupExport->shouldNotReceive('timeout');
- $BackupExport->shouldNotReceive('filename');
- $BackupExport->shouldNotReceive('compression');
- $BackupExport->shouldReceive('export')->once()->andReturn($expectedFilename);
+ $BackupExport
+ ->shouldReceive('__construct')
+ ->once()
+ ->with('');
+ $BackupExport
+ ->shouldNotReceive('timeout');
+ $BackupExport
+ ->shouldNotReceive('filename');
+ $BackupExport
+ ->shouldNotReceive('compression');
+ $BackupExport
+ ->shouldReceive('export')
+ ->once()
+ ->andReturn($expectedFilename);
$this->exec('database_backup.export');
@@ -93,6 +107,9 @@ public function testExecute(): void
$this->assertOutputContains('Backup `' . $expectedFilename . '` has been exported');
}
+ /**
+ * @link \DatabaseBackup\Command\ExportCommand::execute()
+ */
#[Test]
#[RunInSeparateProcess]
public function testExecuteWithSomeOptions(): void
@@ -100,12 +117,25 @@ public function testExecuteWithSomeOptions(): void
$filename = 'custom_filename.sql';
$BackupExport = Mockery::mock('overload:' . BackupExport::class);
- $BackupExport->shouldReceive('__construct')->with('custom_connection')->once();
- $BackupExport->shouldReceive('timeout')->with(120)->once();
- $BackupExport->shouldReceive('filename')->with($filename)->once();
+ $BackupExport
+ ->shouldReceive('__construct')
+ ->once()
+ ->with('custom_connection');
+ $BackupExport
+ ->shouldReceive('timeout')
+ ->once()
+ ->with(120);
+ $BackupExport
+ ->shouldReceive('filename')
+ ->once()
+ ->with($filename);
//Note that in this case the `--compression` option was passed, but is ignored
- $BackupExport->shouldNotReceive('compression');
- $BackupExport->shouldReceive('export')->once()->andReturn($filename);
+ $BackupExport
+ ->shouldNotReceive('compression');
+ $BackupExport
+ ->shouldReceive('export')
+ ->once()
+ ->andReturn($filename);
$this->exec('database_backup.export --connection custom_connection --timeout 120 --compression gzip --filename ' . $filename);
@@ -113,16 +143,30 @@ public function testExecuteWithSomeOptions(): void
$this->assertOutputContains('Backup `' . $filename . '` has been exported');
}
+ /**
+ * @link \DatabaseBackup\Command\ExportCommand::execute()
+ */
#[Test]
#[RunInSeparateProcess]
public function testExecuteWithCompressionOption(): void
{
$BackupExport = Mockery::mock('overload:' . BackupExport::class);
- $BackupExport->shouldReceive('__construct')->with('')->once();
- $BackupExport->shouldNotReceive('timeout');
- $BackupExport->shouldNotReceive('filename');
- $BackupExport->shouldReceive('compression')->with('gzip')->once();
- $BackupExport->shouldReceive('export')->once()->andReturn('my_backup.sql.gz');
+ $BackupExport
+ ->shouldReceive('__construct')
+ ->once()
+ ->with('');
+ $BackupExport
+ ->shouldNotReceive('timeout');
+ $BackupExport
+ ->shouldNotReceive('filename');
+ $BackupExport
+ ->shouldReceive('compression')
+ ->once()
+ ->with('gzip');
+ $BackupExport
+ ->shouldReceive('export')
+ ->once()
+ ->andReturn('my_backup.sql.gz');
$this->exec('database_backup.export --compression gzip');
@@ -130,27 +174,36 @@ public function testExecuteWithCompressionOption(): void
$this->assertOutputContains('Backup `my_backup.sql.gz` has been exported');
}
+ /**
+ * @link \DatabaseBackup\Command\ExportCommand::execute()
+ */
#[Test]
#[RunInSeparateProcess]
public function testExecuteOnException(): void
{
- $BackupExport = Mockery::mock('overload:' . BackupExport::class);
- $BackupExport->shouldReceive('export')->once()->andThrow(new Exception('Exception message'));
+ Mockery::mock('overload:' . BackupExport::class)
+ ->shouldReceive('export')
+ ->once()
+ ->andThrow(new Exception('Exception message'));
$this->exec('database_backup.export');
$this->assertExitError();
$this->assertErrorContains('Exception message');
}
+ /**
+ * @link \DatabaseBackup\Command\ExportCommand::execute()
+ */
#[Test]
#[RunInSeparateProcess]
public function testExecuteOnStoppedEvent(): void
{
- $BackupExport = Mockery::mock('overload:' . BackupExport::class);
- $BackupExport->shouldReceive('export')->once()->andReturnFalse();
+ Mockery::mock('overload:' . BackupExport::class)
+ ->shouldReceive('export')
+ ->once()
+ ->andReturnFalse();
$this->exec('database_backup.export');
-
$this->assertExitError();
$this->assertErrorContains('The `Backup.beforeExport` event stopped the operation');
}
diff --git a/tests/TestCase/Utility/BackupExportTest.php b/tests/TestCase/Utility/BackupExportTest.php
index c3803ee1..1783c380 100644
--- a/tests/TestCase/Utility/BackupExportTest.php
+++ b/tests/TestCase/Utility/BackupExportTest.php
@@ -36,7 +36,7 @@
use ValueError;
/**
- * BackupExportTest
+ * BackupExportTest.
*/
#[CoversClass(BackupExport::class)]
class BackupExportTest extends TestCase
@@ -51,6 +51,15 @@ public function setUp(): void
parent::setUp();
$this->BackupExport = new BackupExport(Connection: new FakeConnection());
+
+ $this->BackupExport->Executor = new class extends FakeExecutor {
+ public function runProcess(string $filename, int $timeout = 60): Process
+ {
+ return new ReflectionClass(Process::class)->newInstanceWithoutConstructor();
+ }
+ };
+
+ $this->BackupExport->Executor->getEventManager()->setEventList(new EventList());
}
/**
@@ -59,6 +68,7 @@ public function setUp(): void
#[Test]
#[TestWith([Compression::None, Compression::None])]
#[TestWith([Compression::Gzip, Compression::Gzip])]
+ #[TestWith([Compression::Bzip2, Compression::Bzip2])]
#[TestWith([Compression::Gzip, 'Gzip'])]
#[TestWith([Compression::Gzip, 'gzip'])]
#[TestWith([Compression::None, null])]
@@ -159,6 +169,9 @@ public function testFilenamePropertyWithInvalidFilenameAndCompression(): void
$this->BackupExport->filename = TMP . 'backup.txt';
}
+ /**
+ * @link \DatabaseBackup\Utility\BackupExport::__call()
+ */
#[Test]
public function testCallMagicMethod(): void
{
@@ -176,25 +189,56 @@ public function testCallMagicMethod(): void
}
/**
+ * Tests for the `export()` method, without calls to the `filename()` and `compression()` methods.
+ *
* @link \DatabaseBackup\Utility\BackupExport::export()
*/
#[Test]
public function testExport(): void
{
- $this->BackupExport->Executor = new class extends FakeExecutor {
- public function runProcess(string $filename, int $timeout = 60): Process
- {
- return new ReflectionClass(Process::class)->newInstanceWithoutConstructor();
- }
- };
- $this->BackupExport->Executor->getEventManager()->setEventList(new EventList());
+ $result = $this->BackupExport->export() ?: '';
+
+ /** @var non-empty-string $targetDir */
+ $targetDir = Configure::read('DatabaseBackup.target');
+ $this->assertStringStartsWith($targetDir, $result);
+ $this->assertMatchesRegularExpression('/backup_my_database_\d{14}\.sql$/', $result);
+ $this->assertEventFired('Backup.beforeExport', $this->BackupExport->Executor->getEventManager());
+ $this->assertEventFired('Backup.afterExport', $this->BackupExport->Executor->getEventManager());
+ }
+ /**
+ * Tests for the `export()` method, with a call to the `compression()` method.
+ *
+ * @link \DatabaseBackup\Utility\BackupExport::export()
+ */
+ #[Test]
+ public function testExportWithCompression(): void
+ {
$result = $this->BackupExport
- ->filename(TMP . 'backup.sql')
- ->timeout(120)
+ ->compression(Compression::Bzip2)
+ ->export() ?: '';
+
+ /** @var non-empty-string $targetDir */
+ $targetDir = Configure::read('DatabaseBackup.target');
+ $this->assertStringStartsWith($targetDir, $result);
+ $this->assertMatchesRegularExpression('/backup_my_database_\d{14}\.sql\.bz2$/', $result);
+ $this->assertEventFired('Backup.beforeExport', $this->BackupExport->Executor->getEventManager());
+ $this->assertEventFired('Backup.afterExport', $this->BackupExport->Executor->getEventManager());
+ }
+
+ /**
+ * Tests for the `export()` method, with a call to the `filename()` method.
+ *
+ * @link \DatabaseBackup\Utility\BackupExport::export()
+ */
+ #[Test]
+ public function testExportWithFilename(): void
+ {
+ $result = $this->BackupExport
+ ->filename(TMP . 'backup.sql.gz')
->export();
- $this->assertSame(TMP . 'backup.sql', $result);
+ $this->assertSame(TMP . 'backup.sql.gz', $result);
$this->assertEventFired('Backup.beforeExport', $this->BackupExport->Executor->getEventManager());
$this->assertEventFired('Backup.afterExport', $this->BackupExport->Executor->getEventManager());
}
@@ -209,12 +253,12 @@ public function testExportWithTimeoutFromConfiguration(): void
Configure::write('DatabaseBackup.processTimeout', 45);
/** @var \DatabaseBackup\Executor\Executor&\Mockery\MockInterface $Executor */
- $Executor = Mockery::mock(FakeExecutor::class)->makePartial();
- $Executor
+ $Executor = Mockery::mock(FakeExecutor::class . '[runProcess]')
->shouldReceive('runProcess')
->with(TMP . 'backup.sql', 45)
->once()
- ->andReturn(new ReflectionClass(Process::class)->newInstanceWithoutConstructor());
+ ->andReturn(new ReflectionClass(Process::class)->newInstanceWithoutConstructor())
+ ->getMock();
$this->BackupExport->Executor = $Executor;
@@ -224,6 +268,7 @@ public function testExportWithTimeoutFromConfiguration(): void
}
/**
+ * Tests for the `export()` method.
* `export()` is stopped by the `Backup.beforeExport` event (implemented by the `Executor` class).
*
* @link \DatabaseBackup\Utility\BackupExport::export()
diff --git a/version b/version
index 4a36342f..cb2b00e4 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-3.0.0
+3.0.1