From f785dd8911641dd7b74de3ce2f5dd837cf542965 Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Fri, 13 Nov 2026 23:07:10 -0600 Subject: [PATCH] Make webware-core an optional dependency Move webware/webware-core from require to require-dev with the same constraint and add a suggest entry. Core is only needed to filter navigation by ACL; without it the helper builds with a null ACL. NavigationFactoryTest now asserts the factory leaves the ACL null when the container does not have one. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 5 +- composer.json | 7 +- composer.lock | 1268 +++++++++++++-------------- docs/testing.md | 4 +- test/unit/NavigationFactoryTest.php | 24 +- 5 files changed, 658 insertions(+), 650 deletions(-) diff --git a/README.md b/README.md index 7a30a8c..a4a35c5 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,9 @@ After each change run `composer update webware/webware-navigation` (the lock pins the commit hash). Note: the package types against `Webware\Core\AclInterface` and -`Webware\Core\UserInterface`, both provided by `webware/webware-core`, which this -package requires. +`Webware\Core\UserInterface`, both provided by `webware/webware-core`. That +package is only needed to filter navigation by ACL. Without it the helper builds +with a null ACL and includes every route in the navigation. Add to `config/config.php`: diff --git a/composer.json b/composer.json index a17d440..772376d 100644 --- a/composer.json +++ b/composer.json @@ -22,8 +22,7 @@ "psr/container": "^2.0", "psr/http-message": "^2.0", "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0", - "webware/webware-core": "^1.0.0-alpha.6" + "psr/http-server-middleware": "^1.0" }, "require-dev": { "infection/infection": "^0.35.0", @@ -32,8 +31,12 @@ "phpunit/phpunit": "^13.4.4", "roave/backward-compatibility-check": "^8.21.0", "roave/security-advisories": "dev-master", + "webware/webware-core": "^1.0.0-alpha.6", "webware/webware-tools": "^1.0.0-rc.14" }, + "suggest": { + "webware/webware-core": "Only needed to filter navigation by ACL; without it the helper builds with a null ACL and the ACL check is skipped" + }, "autoload": { "psr-4": { "Webware\\Navigation\\": "src/" diff --git a/composer.lock b/composer.lock index 3cbe1cc..6e63428 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": "0d9dd32de90efa975232b614dd0573f7", + "content-hash": "35a5dac227714d997b25691940d64abd", "packages": [ { "name": "brick/varexporter", @@ -175,223 +175,6 @@ "time": "2025-10-14T18:31:13+00:00", "published-time": "2025-10-14T19:13:23+00:00" }, - { - "name": "laminas/laminas-filter", - "version": "3.4.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-filter.git", - "reference": "5aac4010c55643d995b6f17e1e7e4bbf0681cd50" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-filter/zipball/5aac4010c55643d995b6f17e1e7e4bbf0681cd50", - "reference": "5aac4010c55643d995b6f17e1e7e4bbf0681cd50", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "ext-filter": "*", - "ext-iconv": "*", - "ext-mbstring": "*", - "laminas/laminas-servicemanager": "^4.1.0", - "laminas/laminas-stdlib": "^3.19.0", - "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "psr/container": "^1 || ^2", - "psr/http-factory": "^1.1", - "psr/http-message": "^2.0" - }, - "require-dev": { - "ext-bz2": "*", - "ext-zip": "*", - "ext-zlib": "*", - "laminas/laminas-coding-standard": "^3.1.0", - "laminas/laminas-diactoros": "^3.8", - "pear/archive_tar": "^1.6.0", - "pear/pear": "^1.10.16", - "phpunit/phpunit": "^11.5.42", - "psalm/plugin-phpunit": "^0.19.5", - "vimeo/psalm": "^6.13.1" - }, - "suggest": { - "laminas/laminas-i18n": "Laminas\\I18n component for filters depending on i18n functionality", - "psr/http-factory-implementation": "psr/http-factory-implementation, for creating file upload instances when consuming PSR-7 in file upload filters" - }, - "type": "library", - "extra": { - "laminas": { - "component": "Laminas\\Filter", - "config-provider": "Laminas\\Filter\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Filter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Programmatically filter and normalize data and files", - "homepage": "https://laminas.dev", - "keywords": [ - "filter", - "laminas" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-filter/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-filter/issues", - "rss": "https://github.com/laminas/laminas-filter/releases.atom", - "source": "https://github.com/laminas/laminas-filter" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2025-11-15T21:02:51+00:00", - "published-time": "2025-11-15T21:03:28+00:00" - }, - { - "name": "laminas/laminas-inputfilter", - "version": "3.0.x-dev", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-inputfilter.git", - "reference": "37deaab3cf0441fb2aab0d87751c638533850820" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-inputfilter/zipball/37deaab3cf0441fb2aab0d87751c638533850820", - "reference": "37deaab3cf0441fb2aab0d87751c638533850820", - "shasum": "" - }, - "require": { - "laminas/laminas-filter": "^3.4.0", - "laminas/laminas-servicemanager": "^4.0", - "laminas/laminas-stdlib": "^3.19", - "laminas/laminas-validator": "^3.11.0", - "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "psr/container": "^1.1 || ^2.0", - "psr/http-message": "^2.0" - }, - "conflict": { - "zendframework/zend-inputfilter": "*" - }, - "require-dev": { - "ext-json": "*", - "laminas/laminas-coding-standard": "^3.1.0", - "phpunit/phpunit": "^11.5.46", - "psalm/plugin-phpunit": "^0.19.5", - "vimeo/psalm": "^6.14.3" - }, - "type": "library", - "extra": { - "laminas": { - "config-provider": "Laminas\\InputFilter\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Laminas\\InputFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Normalize and validate input sets from the web, APIs, the CLI, and more, including files", - "homepage": "https://laminas.dev", - "keywords": [ - "inputfilter", - "laminas" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-inputfilter/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-inputfilter/issues", - "rss": "https://github.com/laminas/laminas-inputfilter/releases.atom", - "source": "https://github.com/laminas/laminas-inputfilter" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2026-06-11T22:00:16+00:00", - "published-time": "2026-06-11T22:00:22+00:00" - }, - { - "name": "laminas/laminas-permissions-acl", - "version": "2.18.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-permissions-acl.git", - "reference": "5940f6e7b9e2e3eba671f13dd26e610d2fe9acc3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/5940f6e7b9e2e3eba671f13dd26e610d2fe9acc3", - "reference": "5940f6e7b9e2e3eba671f13dd26e610d2fe9acc3", - "shasum": "" - }, - "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" - }, - "conflict": { - "laminas/laminas-servicemanager": "<3.0", - "zendframework/zend-permissions-acl": "*" - }, - "require-dev": { - "laminas/laminas-coding-standard": "^3.0.1", - "laminas/laminas-servicemanager": "^3.21", - "phpbench/phpbench": "^1.2.10", - "phpunit/phpunit": "^10.5.58", - "psalm/plugin-phpunit": "^0.19.0", - "vimeo/psalm": "^6.13.1" - }, - "suggest": { - "laminas/laminas-servicemanager": "To support Laminas\\Permissions\\Acl\\Assertion\\AssertionManager plugin manager usage" - }, - "type": "library", - "autoload": { - "psr-4": { - "Laminas\\Permissions\\Acl\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Provides a lightweight and flexible access control list (ACL) implementation for privileges management", - "homepage": "https://laminas.dev", - "keywords": [ - "acl", - "laminas" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-permissions-acl/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-permissions-acl/issues", - "rss": "https://github.com/laminas/laminas-permissions-acl/releases.atom", - "source": "https://github.com/laminas/laminas-permissions-acl" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2025-11-03T09:15:20+00:00", - "published-time": "2025-11-03T09:16:45+00:00" - }, { "name": "laminas/laminas-servicemanager", "version": "4.5.1", @@ -594,115 +377,35 @@ "published-time": "2026-06-02T11:37:21+00:00" }, { - "name": "laminas/laminas-validator", - "version": "3.19.0", + "name": "laminas/laminas-view", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-validator.git", - "reference": "98fb22b3965c322f5087856dcc4a702c3e3b0b70" + "url": "https://github.com/laminas/laminas-view.git", + "reference": "b734610c8a83bc49b32536dd7dccd2f13ab3f601" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/98fb22b3965c322f5087856dcc4a702c3e3b0b70", - "reference": "98fb22b3965c322f5087856dcc4a702c3e3b0b70", + "url": "https://api.github.com/repos/laminas/laminas-view/zipball/b734610c8a83bc49b32536dd7dccd2f13ab3f601", + "reference": "b734610c8a83bc49b32536dd7dccd2f13ab3f601", "shasum": "" }, "require": { - "ext-ctype": "*", - "ext-fileinfo": "*", - "ext-filter": "*", - "ext-intl": "*", + "ext-json": "*", + "laminas/laminas-escaper": "^2.17.0", "laminas/laminas-servicemanager": "^4.4.0", - "laminas/laminas-stdlib": "^3.19", - "laminas/laminas-translator": "^1.0 || ^2.0", + "laminas/laminas-stdlib": "^3.10.1", + "laminas/laminas-translator": "^1.1 || ^2.0", "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "psr/container": "^1.1 || ^2.0", - "psr/http-client": "^1.0.3", - "psr/http-factory": "^1.1.0", - "psr/http-message": "^1.0.1 || ^2.0.0" + "psr/container": "^1 || ^2" }, "require-dev": { - "boundwize/structarmed": "^0.18.11", - "laminas/laminas-coding-standard": "^3.1.0", - "laminas/laminas-diactoros": "^3.8.0", - "laminas/laminas-translator": "^2.0", - "phpunit/phpunit": "^11.5.55", + "amphp/dns": "^2.4.0", + "amphp/socket": "^2.4.0", + "laminas/laminas-coding-standard": "~3.1.0", + "phpunit/phpunit": "^11.5.55 || ^12.5.9", "psalm/plugin-phpunit": "^0.19.7", - "vimeo/psalm": "^6.16.1" - }, - "suggest": { - "laminas/laminas-i18n": "Laminas\\I18n component to allow translation of validation error messages", - "laminas/laminas-i18n-resources": "Translations of validator messages" - }, - "type": "library", - "extra": { - "laminas": { - "component": "Laminas\\Validator", - "config-provider": "Laminas\\Validator\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Laminas\\Validator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria", - "homepage": "https://laminas.dev", - "keywords": [ - "laminas", - "validator" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-validator/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-validator/issues", - "rss": "https://github.com/laminas/laminas-validator/releases.atom", - "source": "https://github.com/laminas/laminas-validator" - }, - "funding": [ - { - "url": "https://crowdfunding.linuxfoundation.org/initiatives/laminas-project", - "type": "custom" - } - ], - "time": "2026-10-28T10:53:16+00:00", - "published-time": "2026-10-28T10:54:23+00:00" - }, - { - "name": "laminas/laminas-view", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-view.git", - "reference": "b734610c8a83bc49b32536dd7dccd2f13ab3f601" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-view/zipball/b734610c8a83bc49b32536dd7dccd2f13ab3f601", - "reference": "b734610c8a83bc49b32536dd7dccd2f13ab3f601", - "shasum": "" - }, - "require": { - "ext-json": "*", - "laminas/laminas-escaper": "^2.17.0", - "laminas/laminas-servicemanager": "^4.4.0", - "laminas/laminas-stdlib": "^3.10.1", - "laminas/laminas-translator": "^1.1 || ^2.0", - "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "psr/container": "^1 || ^2" - }, - "require-dev": { - "amphp/dns": "^2.4.0", - "amphp/socket": "^2.4.0", - "laminas/laminas-coding-standard": "~3.1.0", - "phpunit/phpunit": "^11.5.55 || ^12.5.9", - "psalm/plugin-phpunit": "^0.19.7", - "symfony/console": "7.4.13", + "symfony/console": "7.4.13", "vimeo/psalm": "^6.16.1" }, "suggest": { @@ -756,87 +459,6 @@ "time": "2026-06-02T22:39:05+00:00", "published-time": "2026-06-02T22:53:16+00:00" }, - { - "name": "mezzio/mezzio-authentication", - "version": "1.13.0", - "source": { - "type": "git", - "url": "https://github.com/mezzio/mezzio-authentication.git", - "reference": "9eec425ab3386ff09dfb686d55887871ba39cc33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-authentication/zipball/9eec425ab3386ff09dfb686d55887871ba39cc33", - "reference": "9eec425ab3386ff09dfb686d55887871ba39cc33", - "shasum": "" - }, - "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", - "psr/container": "^1.0 || ^2.0", - "psr/http-message": "^1.0.1 || ^2.0.0", - "psr/http-server-middleware": "^1.0", - "webmozart/assert": "^1.11.0 || ^2.0.0" - }, - "conflict": { - "container-interop/container-interop": "<1.2.0", - "zendframework/zend-expressive-authentication": "*" - }, - "require-dev": { - "ext-sqlite3": "*", - "laminas/laminas-coding-standard": "~3.1.0", - "phpunit/phpunit": "^11.5.42", - "psalm/plugin-phpunit": "^0.19.5", - "vimeo/psalm": "^6.13.1" - }, - "suggest": { - "ext-pdo": "*: for use with the PDO-backed UserRepositoryInterface implementation", - "mezzio/mezzio-authentication-basic": "Provides an HTTP Basic Authentication AuthenticationInterface implementation", - "mezzio/mezzio-authentication-laminasauthentication": "Provides a laminas-authentication AuthenticationInterface implementation", - "mezzio/mezzio-authentication-session": "Provides a username/password + session AuthenticationInterface implementation" - }, - "type": "library", - "extra": { - "laminas": { - "config-provider": "Mezzio\\Authentication\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "Mezzio\\Authentication\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Authentication middleware for Mezzio and PSR-7 applications", - "homepage": "https://mezzio.dev", - "keywords": [ - "Authentication", - "http", - "laminas", - "mezzio", - "middleware", - "psr-15", - "psr-7" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.mezzio.dev/mezzio-authentication/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/mezzio/mezzio-authentication/issues", - "rss": "https://github.com/mezzio/mezzio-authentication/releases.atom", - "source": "https://github.com/mezzio/mezzio-authentication" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2026-02-27T12:38:47+00:00", - "published-time": "2026-02-27T12:39:23+00:00" - }, { "name": "mezzio/mezzio-router", "version": "4.2.0", @@ -977,74 +599,6 @@ "time": "2026-09-13T18:51:52+00:00", "published-time": "2026-09-13T18:53:16+00:00" }, - { - "name": "php-db/phpdb", - "version": "0.6.x-dev", - "source": { - "type": "git", - "url": "https://github.com/php-db/phpdb.git", - "reference": "1570a6122cde75699394a6a38cf17335c3b1d622" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-db/phpdb/zipball/1570a6122cde75699394a6a38cf17335c3b1d622", - "reference": "1570a6122cde75699394a6a38cf17335c3b1d622", - "shasum": "" - }, - "require": { - "laminas/laminas-servicemanager": "^3.0.0 || ^4.0.0", - "laminas/laminas-stdlib": "^3.20.0", - "php": "~8.3.0 || ~8.4.0 || ~8.5.0" - }, - "conflict": { - "zendframework/zend-db": "*" - }, - "require-dev": { - "infection/infection": "^0.34.1", - "laminas/laminas-eventmanager": "^3.14.0", - "laminas/laminas-hydrator": "^4.6.0", - "php-db/phpdb-qa-tools": "0.1.x-dev", - "phpbench/phpbench": "^1.4", - "phpunit/phpunit": "^11.5.42", - "rector/rector": "^2.0" - }, - "suggest": { - "laminas/laminas-eventmanager": "Laminas\\EventManager component", - "laminas/laminas-hydrator": "(^5.0.0) Laminas\\Hydrator component for using HydratingResultSets" - }, - "default-branch": true, - "type": "library", - "extra": { - "laminas": { - "config-provider": "PhpDb\\ConfigProvider" - } - }, - "autoload": { - "psr-4": { - "PhpDb\\": "src/", - "CustomRule\\PHPUnit\\": "rector/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations", - "homepage": "https://php-db.dev", - "keywords": [ - "db", - "laminas", - "mezzio", - "php-db" - ], - "support": { - "docs": "https://docs.php-db.dev/", - "issues": "https://github.com/php-db/phpdb/issues", - "source": "https://github.com/php-db/phpdb" - }, - "time": "2026-10-27T04:40:00+00:00", - "published-time": "2026-10-27T04:40:05+00:00" - }, { "name": "psr/container", "version": "2.0.2", @@ -1100,21 +654,21 @@ "published-time": "2021-11-05T16:53:27+00:00" }, { - "name": "psr/http-client", - "version": "1.0.3", + "name": "psr/http-factory", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": "^7.0 || ^8.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -1125,7 +679,7 @@ }, "autoload": { "psr-4": { - "Psr\\Http\\Client\\": "src/" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1138,75 +692,22 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ + "factory", "http", - "http-client", + "message", "psr", - "psr-18" + "psr-17", + "psr-7", + "request", + "response" ], "support": { - "source": "https://github.com/php-fig/http-client" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-09-23T14:17:50+00:00", - "published-time": "2023-09-23T14:18:12+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory" - }, - "time": "2024-04-15T12:06:14+00:00", - "published-time": "2024-05-10T07:32:19+00:00" + "time": "2024-04-15T12:06:14+00:00", + "published-time": "2024-05-10T07:32:19+00:00" }, { "name": "psr/http-message", @@ -1443,72 +944,6 @@ }, "time": "2026-10-05T23:14:19+00:00", "published-time": "2026-10-05T23:14:25+00:00" - }, - { - "name": "webware/webware-core", - "version": "1.0.0-alpha.11", - "source": { - "type": "git", - "url": "https://github.com/webinertia/webware-core.git", - "reference": "b99319fb58c90a1c716fed8e14a2be264719664d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webinertia/webware-core/zipball/b99319fb58c90a1c716fed8e14a2be264719664d", - "reference": "b99319fb58c90a1c716fed8e14a2be264719664d", - "shasum": "" - }, - "require": { - "fig/http-message-util": "^1.1", - "laminas/laminas-inputfilter": "3.0.x-dev", - "laminas/laminas-permissions-acl": "^2.16", - "mezzio/mezzio-authentication": "^1.13", - "php": "~8.4.1 || ~8.5.0", - "php-db/phpdb": "^0.6.x-dev", - "psr/http-message": "^2.0", - "psr/http-server-handler": "^1.0", - "psr/http-server-middleware": "^1.0" - }, - "require-dev": { - "infection/infection": "^0.35.0", - "laminas/laminas-diactoros": "^3.8", - "laminas/laminas-filter": "3.5.x-dev", - "php-db/phpdb": "^0.6.0", - "phpbench/phpbench": "^1.7", - "phpunit/phpunit": "^13.3", - "roave/backward-compatibility-check": "^8.21.0", - "roave/security-advisories": "dev-master", - "webware/webware-tools": "^1.0.0-rc.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webware\\Core\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Joey Smith", - "email": "jsmith@webinertia.net", - "role": "Developer" - } - ], - "description": "Contracts and utilities for the webware-* ecosystem.", - "keywords": [ - "core", - "mezzio", - "webware" - ], - "support": { - "issues": "https://github.com/webinertia/webware-core/issues", - "source": "https://github.com/webinertia/webware-core/tree/1.0.0-alpha.11" - }, - "time": "2026-10-25T23:53:07+00:00", - "published-time": "2026-10-25T23:56:22+00:00" } ], "packages-dev": [ @@ -2998,6 +2433,303 @@ "time": "2026-10-24T08:53:34+00:00", "published-time": "2026-10-24T08:53:38+00:00" }, + { + "name": "laminas/laminas-filter", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-filter.git", + "reference": "5aac4010c55643d995b6f17e1e7e4bbf0681cd50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-filter/zipball/5aac4010c55643d995b6f17e1e7e4bbf0681cd50", + "reference": "5aac4010c55643d995b6f17e1e7e4bbf0681cd50", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-filter": "*", + "ext-iconv": "*", + "ext-mbstring": "*", + "laminas/laminas-servicemanager": "^4.1.0", + "laminas/laminas-stdlib": "^3.19.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "psr/container": "^1 || ^2", + "psr/http-factory": "^1.1", + "psr/http-message": "^2.0" + }, + "require-dev": { + "ext-bz2": "*", + "ext-zip": "*", + "ext-zlib": "*", + "laminas/laminas-coding-standard": "^3.1.0", + "laminas/laminas-diactoros": "^3.8", + "pear/archive_tar": "^1.6.0", + "pear/pear": "^1.10.16", + "phpunit/phpunit": "^11.5.42", + "psalm/plugin-phpunit": "^0.19.5", + "vimeo/psalm": "^6.13.1" + }, + "suggest": { + "laminas/laminas-i18n": "Laminas\\I18n component for filters depending on i18n functionality", + "psr/http-factory-implementation": "psr/http-factory-implementation, for creating file upload instances when consuming PSR-7 in file upload filters" + }, + "type": "library", + "extra": { + "laminas": { + "component": "Laminas\\Filter", + "config-provider": "Laminas\\Filter\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Laminas\\Filter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Programmatically filter and normalize data and files", + "homepage": "https://laminas.dev", + "keywords": [ + "filter", + "laminas" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-filter/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-filter/issues", + "rss": "https://github.com/laminas/laminas-filter/releases.atom", + "source": "https://github.com/laminas/laminas-filter" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2025-11-15T21:02:51+00:00", + "published-time": "2025-11-15T21:03:28+00:00" + }, + { + "name": "laminas/laminas-inputfilter", + "version": "3.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-inputfilter.git", + "reference": "37deaab3cf0441fb2aab0d87751c638533850820" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-inputfilter/zipball/37deaab3cf0441fb2aab0d87751c638533850820", + "reference": "37deaab3cf0441fb2aab0d87751c638533850820", + "shasum": "" + }, + "require": { + "laminas/laminas-filter": "^3.4.0", + "laminas/laminas-servicemanager": "^4.0", + "laminas/laminas-stdlib": "^3.19", + "laminas/laminas-validator": "^3.11.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "psr/container": "^1.1 || ^2.0", + "psr/http-message": "^2.0" + }, + "conflict": { + "zendframework/zend-inputfilter": "*" + }, + "require-dev": { + "ext-json": "*", + "laminas/laminas-coding-standard": "^3.1.0", + "phpunit/phpunit": "^11.5.46", + "psalm/plugin-phpunit": "^0.19.5", + "vimeo/psalm": "^6.14.3" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\InputFilter\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Laminas\\InputFilter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Normalize and validate input sets from the web, APIs, the CLI, and more, including files", + "homepage": "https://laminas.dev", + "keywords": [ + "inputfilter", + "laminas" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-inputfilter/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-inputfilter/issues", + "rss": "https://github.com/laminas/laminas-inputfilter/releases.atom", + "source": "https://github.com/laminas/laminas-inputfilter" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2026-06-11T22:00:16+00:00", + "published-time": "2026-06-11T22:00:22+00:00" + }, + { + "name": "laminas/laminas-permissions-acl", + "version": "2.18.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-permissions-acl.git", + "reference": "5940f6e7b9e2e3eba671f13dd26e610d2fe9acc3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/5940f6e7b9e2e3eba671f13dd26e610d2fe9acc3", + "reference": "5940f6e7b9e2e3eba671f13dd26e610d2fe9acc3", + "shasum": "" + }, + "require": { + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" + }, + "conflict": { + "laminas/laminas-servicemanager": "<3.0", + "zendframework/zend-permissions-acl": "*" + }, + "require-dev": { + "laminas/laminas-coding-standard": "^3.0.1", + "laminas/laminas-servicemanager": "^3.21", + "phpbench/phpbench": "^1.2.10", + "phpunit/phpunit": "^10.5.58", + "psalm/plugin-phpunit": "^0.19.0", + "vimeo/psalm": "^6.13.1" + }, + "suggest": { + "laminas/laminas-servicemanager": "To support Laminas\\Permissions\\Acl\\Assertion\\AssertionManager plugin manager usage" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laminas\\Permissions\\Acl\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Provides a lightweight and flexible access control list (ACL) implementation for privileges management", + "homepage": "https://laminas.dev", + "keywords": [ + "acl", + "laminas" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-permissions-acl/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-permissions-acl/issues", + "rss": "https://github.com/laminas/laminas-permissions-acl/releases.atom", + "source": "https://github.com/laminas/laminas-permissions-acl" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2025-11-03T09:15:20+00:00", + "published-time": "2025-11-03T09:16:45+00:00" + }, + { + "name": "laminas/laminas-validator", + "version": "3.19.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-validator.git", + "reference": "98fb22b3965c322f5087856dcc4a702c3e3b0b70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/98fb22b3965c322f5087856dcc4a702c3e3b0b70", + "reference": "98fb22b3965c322f5087856dcc4a702c3e3b0b70", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-fileinfo": "*", + "ext-filter": "*", + "ext-intl": "*", + "laminas/laminas-servicemanager": "^4.4.0", + "laminas/laminas-stdlib": "^3.19", + "laminas/laminas-translator": "^1.0 || ^2.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "psr/container": "^1.1 || ^2.0", + "psr/http-client": "^1.0.3", + "psr/http-factory": "^1.1.0", + "psr/http-message": "^1.0.1 || ^2.0.0" + }, + "require-dev": { + "boundwize/structarmed": "^0.18.11", + "laminas/laminas-coding-standard": "^3.1.0", + "laminas/laminas-diactoros": "^3.8.0", + "laminas/laminas-translator": "^2.0", + "phpunit/phpunit": "^11.5.55", + "psalm/plugin-phpunit": "^0.19.7", + "vimeo/psalm": "^6.16.1" + }, + "suggest": { + "laminas/laminas-i18n": "Laminas\\I18n component to allow translation of validation error messages", + "laminas/laminas-i18n-resources": "Translations of validator messages" + }, + "type": "library", + "extra": { + "laminas": { + "component": "Laminas\\Validator", + "config-provider": "Laminas\\Validator\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Laminas\\Validator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria", + "homepage": "https://laminas.dev", + "keywords": [ + "laminas", + "validator" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-validator/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-validator/issues", + "rss": "https://github.com/laminas/laminas-validator/releases.atom", + "source": "https://github.com/laminas/laminas-validator" + }, + "funding": [ + { + "url": "https://crowdfunding.linuxfoundation.org/initiatives/laminas-project", + "type": "custom" + } + ], + "time": "2026-10-28T10:53:16+00:00", + "published-time": "2026-10-28T10:54:23+00:00" + }, { "name": "marc-mabe/php-enum", "version": "v4.7.2", @@ -3024,53 +2756,134 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-3.x": "3.2-dev", - "dev-master": "4.7-dev" + "branch-alias": { + "dev-3.x": "3.2-dev", + "dev-master": "4.7-dev" + } + }, + "autoload": { + "psr-4": { + "MabeEnum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Marc Bennewitz", + "email": "dev@mabe.berlin", + "homepage": "https://mabe.berlin/", + "role": "Lead" + } + ], + "description": "Simple and fast implementation of enumerations with native PHP", + "homepage": "https://github.com/marc-mabe/php-enum", + "keywords": [ + "enum", + "enum-map", + "enum-set", + "enumeration", + "enumerator", + "enummap", + "enumset", + "map", + "set", + "type", + "type-hint", + "typehint" + ], + "support": { + "issues": "https://github.com/marc-mabe/php-enum/issues", + "source": "https://github.com/marc-mabe/php-enum/tree/v4.7.2" + }, + "time": "2025-09-14T11:18:39+00:00", + "published-time": "2025-09-14T11:32:17+00:00" + }, + { + "name": "mezzio/mezzio-authentication", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/mezzio/mezzio-authentication.git", + "reference": "9eec425ab3386ff09dfb686d55887871ba39cc33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mezzio/mezzio-authentication/zipball/9eec425ab3386ff09dfb686d55887871ba39cc33", + "reference": "9eec425ab3386ff09dfb686d55887871ba39cc33", + "shasum": "" + }, + "require": { + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "psr/container": "^1.0 || ^2.0", + "psr/http-message": "^1.0.1 || ^2.0.0", + "psr/http-server-middleware": "^1.0", + "webmozart/assert": "^1.11.0 || ^2.0.0" + }, + "conflict": { + "container-interop/container-interop": "<1.2.0", + "zendframework/zend-expressive-authentication": "*" + }, + "require-dev": { + "ext-sqlite3": "*", + "laminas/laminas-coding-standard": "~3.1.0", + "phpunit/phpunit": "^11.5.42", + "psalm/plugin-phpunit": "^0.19.5", + "vimeo/psalm": "^6.13.1" + }, + "suggest": { + "ext-pdo": "*: for use with the PDO-backed UserRepositoryInterface implementation", + "mezzio/mezzio-authentication-basic": "Provides an HTTP Basic Authentication AuthenticationInterface implementation", + "mezzio/mezzio-authentication-laminasauthentication": "Provides a laminas-authentication AuthenticationInterface implementation", + "mezzio/mezzio-authentication-session": "Provides a username/password + session AuthenticationInterface implementation" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Mezzio\\Authentication\\ConfigProvider" } }, "autoload": { "psr-4": { - "MabeEnum\\": "src/" - }, - "classmap": [ - "stubs/Stringable.php" - ] + "Mezzio\\Authentication\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "authors": [ - { - "name": "Marc Bennewitz", - "email": "dev@mabe.berlin", - "homepage": "https://mabe.berlin/", - "role": "Lead" - } - ], - "description": "Simple and fast implementation of enumerations with native PHP", - "homepage": "https://github.com/marc-mabe/php-enum", + "description": "Authentication middleware for Mezzio and PSR-7 applications", + "homepage": "https://mezzio.dev", "keywords": [ - "enum", - "enum-map", - "enum-set", - "enumeration", - "enumerator", - "enummap", - "enumset", - "map", - "set", - "type", - "type-hint", - "typehint" + "Authentication", + "http", + "laminas", + "mezzio", + "middleware", + "psr-15", + "psr-7" ], "support": { - "issues": "https://github.com/marc-mabe/php-enum/issues", - "source": "https://github.com/marc-mabe/php-enum/tree/v4.7.2" + "chat": "https://laminas.dev/chat", + "docs": "https://docs.mezzio.dev/mezzio-authentication/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/mezzio/mezzio-authentication/issues", + "rss": "https://github.com/mezzio/mezzio-authentication/releases.atom", + "source": "https://github.com/mezzio/mezzio-authentication" }, - "time": "2025-09-14T11:18:39+00:00", - "published-time": "2025-09-14T11:32:17+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2026-02-27T12:38:47+00:00", + "published-time": "2026-02-27T12:39:23+00:00" }, { "name": "myclabs/deep-copy", @@ -3458,6 +3271,74 @@ "time": "2022-02-21T01:04:05+00:00", "published-time": "2022-02-21T01:04:30+00:00" }, + { + "name": "php-db/phpdb", + "version": "0.6.x-dev", + "source": { + "type": "git", + "url": "https://github.com/php-db/phpdb.git", + "reference": "1570a6122cde75699394a6a38cf17335c3b1d622" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-db/phpdb/zipball/1570a6122cde75699394a6a38cf17335c3b1d622", + "reference": "1570a6122cde75699394a6a38cf17335c3b1d622", + "shasum": "" + }, + "require": { + "laminas/laminas-servicemanager": "^3.0.0 || ^4.0.0", + "laminas/laminas-stdlib": "^3.20.0", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0" + }, + "conflict": { + "zendframework/zend-db": "*" + }, + "require-dev": { + "infection/infection": "^0.34.1", + "laminas/laminas-eventmanager": "^3.14.0", + "laminas/laminas-hydrator": "^4.6.0", + "php-db/phpdb-qa-tools": "0.1.x-dev", + "phpbench/phpbench": "^1.4", + "phpunit/phpunit": "^11.5.42", + "rector/rector": "^2.0" + }, + "suggest": { + "laminas/laminas-eventmanager": "Laminas\\EventManager component", + "laminas/laminas-hydrator": "(^5.0.0) Laminas\\Hydrator component for using HydratingResultSets" + }, + "default-branch": true, + "type": "library", + "extra": { + "laminas": { + "config-provider": "PhpDb\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "PhpDb\\": "src/", + "CustomRule\\PHPUnit\\": "rector/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Database abstraction layer, SQL abstraction, result set abstraction, and RowDataGateway and TableDataGateway implementations", + "homepage": "https://php-db.dev", + "keywords": [ + "db", + "laminas", + "mezzio", + "php-db" + ], + "support": { + "docs": "https://docs.php-db.dev/", + "issues": "https://github.com/php-db/phpdb/issues", + "source": "https://github.com/php-db/phpdb" + }, + "time": "2026-10-27T04:40:00+00:00", + "published-time": "2026-10-27T04:40:05+00:00" + }, { "name": "php-standard-library/async", "version": "6.4.2", @@ -6030,6 +5911,59 @@ "time": "2022-11-25T14:36:26+00:00", "published-time": "2022-11-25T14:59:22+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00", + "published-time": "2023-09-23T14:18:12+00:00" + }, { "name": "psr/log", "version": "3.0.2", @@ -10755,6 +10689,72 @@ "time": "2024-03-07T20:33:40+00:00", "published-time": "2024-03-07T20:34:42+00:00" }, + { + "name": "webware/webware-core", + "version": "1.0.0-alpha.11", + "source": { + "type": "git", + "url": "https://github.com/webinertia/webware-core.git", + "reference": "b99319fb58c90a1c716fed8e14a2be264719664d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webinertia/webware-core/zipball/b99319fb58c90a1c716fed8e14a2be264719664d", + "reference": "b99319fb58c90a1c716fed8e14a2be264719664d", + "shasum": "" + }, + "require": { + "fig/http-message-util": "^1.1", + "laminas/laminas-inputfilter": "3.0.x-dev", + "laminas/laminas-permissions-acl": "^2.16", + "mezzio/mezzio-authentication": "^1.13", + "php": "~8.4.1 || ~8.5.0", + "php-db/phpdb": "^0.6.x-dev", + "psr/http-message": "^2.0", + "psr/http-server-handler": "^1.0", + "psr/http-server-middleware": "^1.0" + }, + "require-dev": { + "infection/infection": "^0.35.0", + "laminas/laminas-diactoros": "^3.8", + "laminas/laminas-filter": "3.5.x-dev", + "php-db/phpdb": "^0.6.0", + "phpbench/phpbench": "^1.7", + "phpunit/phpunit": "^13.3", + "roave/backward-compatibility-check": "^8.21.0", + "roave/security-advisories": "dev-master", + "webware/webware-tools": "^1.0.0-rc.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webware\\Core\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Joey Smith", + "email": "jsmith@webinertia.net", + "role": "Developer" + } + ], + "description": "Contracts and utilities for the webware-* ecosystem.", + "keywords": [ + "core", + "mezzio", + "webware" + ], + "support": { + "issues": "https://github.com/webinertia/webware-core/issues", + "source": "https://github.com/webinertia/webware-core/tree/1.0.0-alpha.11" + }, + "time": "2026-10-25T23:53:07+00:00", + "published-time": "2026-10-25T23:56:22+00:00" + }, { "name": "webware/webware-tools", "version": "1.0.0-rc.14", diff --git a/docs/testing.md b/docs/testing.md index f8fc5fc..0a0189a 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -13,8 +13,8 @@ ## Unit testing the filter iterator Both contracts - `Webware\Core\AclInterface` and `Webware\Core\UserInterface` - -ship in `webware/webware-core`, which this package requires, so these tests run like -any other. +ship in `webware/webware-core`, which this package requires for development only, +so these tests run like any other. `NavigationFilterIterator` is the easiest component to test in isolation. Construct it with a stub `AclInterface` and an array of `Route` objects: diff --git a/test/unit/NavigationFactoryTest.php b/test/unit/NavigationFactoryTest.php index 6f14ad8..4fc6a9b 100644 --- a/test/unit/NavigationFactoryTest.php +++ b/test/unit/NavigationFactoryTest.php @@ -20,6 +20,7 @@ use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; +use ReflectionProperty; use Webware\Core\AclInterface; use Webware\Navigation\View\Helper\Navigation; use Webware\Navigation\View\Helper\NavigationFactory; @@ -32,38 +33,41 @@ final class NavigationFactoryTest extends TestCase * @throws \PHPUnit\Exception */ #[Test] - public function passesTheRegisteredAclToTheHelper(): void + public function buildsTheHelperWithANullAclWhenTheContainerLacksOne(): void { $routeCollector = $this->createStub(RouteCollectorInterface::class); - $acl = $this->createStub(AclInterface::class); $container = $this->createStub(ContainerInterface::class); - $container->method('has')->willReturn(true); + $container->method('has')->willReturn(false); $container ->method('get') ->willReturnCallback( - static fn(string $id): RouteCollectorInterface|AclInterface => AclInterface::class === $id - ? $acl - : $routeCollector, + static fn(string $id): RouteCollectorInterface => $routeCollector, ); - static::assertInstanceOf(Navigation::class, new NavigationFactory()($container)); + $helper = new NavigationFactory()($container); + + static::assertInstanceOf(Navigation::class, $helper); + static::assertNull(new ReflectionProperty(Navigation::class, 'acl')->getValue($helper)); } /** * @throws \PHPUnit\Exception */ #[Test] - public function resolvesTheHelperWhenNoAclServiceIsRegistered(): void + public function passesTheRegisteredAclToTheHelper(): void { $routeCollector = $this->createStub(RouteCollectorInterface::class); + $acl = $this->createStub(AclInterface::class); $container = $this->createStub(ContainerInterface::class); - $container->method('has')->willReturn(false); + $container->method('has')->willReturn(true); $container ->method('get') ->willReturnCallback( - static fn(string $id): RouteCollectorInterface => $routeCollector, + static fn(string $id): RouteCollectorInterface|AclInterface => AclInterface::class === $id + ? $acl + : $routeCollector, ); static::assertInstanceOf(Navigation::class, new NavigationFactory()($container));