mtymek / blast-test-utils
Utilities for testing integrity of services managed by Laminas\ServiceManager
Installs: 10 449
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.4 || ~8.0
- laminas/laminas-servicemanager: ^3.1
Requires (Dev)
- phpunit/phpunit: ^9.1
- squizlabs/php_codesniffer: ^3.0
README
Utilities for testing integrity of services managed by Zend\ServiceManager.
Installation
Install this library using composer:
$ composer require mtymek/blast-test-utils
Usage
Use ServiceIntegrityTestTrait
to build test that validates integrity of your service manager configuration.
It requires to static methos: getConfig
that loads full application config, and getServiceManagerConfigKey
providing name of configuration key used to set up ServiceManager.
Example usage for zend-expressive
application:
<?php namespace Integration; use Blast\TestUtils\ServiceIntegrityTestTrait; use PHPUnit_Framework_TestCase; class ServiceContainerIntegrityTest extends PHPUnit_Framework_TestCase { use ServiceIntegrityTestTrait; private static function getConfig() { return include 'config/config.php'; } private static function getServiceManagerConfigKey() { return 'dependencies'; } }