polaris / testing
In-memory adapter, fakes and fixtures for testing applications built on Polaris for PHP
Requires
- php: >=8.3
- polaris/core: ^0.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-10 19:54:26 UTC
README
Test support for applications built on Polaris for PHP:
InMemoryAdapter, a Polaris\Contract\DatabaseAdapter over PHP arrays with the same
criteria, ordering, limit, increment and transaction semantics as polaris/pdo, so auth flows
can be tested without a database.
Install
composer require --dev polaris/testing
Use
use Polaris\Testing\InMemoryAdapter; $polaris = Polaris::create(new Config( secrets: $secrets, auth: $auth, database: new InMemoryAdapter(), ));
Seed the permission catalog and system roles as in production
(Polaris\Authorization\PermissionCatalogSeeder), then drive the services or the HTTP
pipeline. Transactions roll back on exceptions, as the PDO adapter's do.
License
MIT. Polaris for PHP is created and maintained by 2am.tech.