Download the PHP package tipowerup/testbench without Composer
On this page you can find all versions of the php package tipowerup/testbench. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tipowerup/testbench
More information about tipowerup/testbench
Files in tipowerup/testbench
Package testbench
Short Description Shared testing foundation for TI PowerUp extensions. Provides full Laravel + TastyIgniter context in tests with dual-mode support (host app and standalone CI).
License MIT
Informations about the package testbench
TI PowerUp Testbench
Shared testing foundation for TI PowerUp TastyIgniter v4 extensions. Provides full Laravel + TastyIgniter context in tests via Orchestra Testbench, with zero duplication across extensions.
Requirements
- PHP ^8.3
- TastyIgniter Core ^v4.0
Installation
Setup
Each extension needs three changes:
1. phpunit.xml.dist
Point the bootstrap to the testbench:
2. tests/TestCase.php
Extend the testbench TestCase and implement the two abstract methods:
3. tests/Pest.php
Bind the TestCase to your test directories:
What You Get
Every test extending the testbench TestCase automatically receives:
- SQLite
:memory:database with foreign key constraints - Array cache driver for isolation
- TI core system tables (
settings,extensions,extension_settings, etc.) Igniter\Flame\ServiceProviderregistered (cascades to all TI core providers)- Extension filesystem scanning disabled (
autoloadExtensions(false)) - Temp directories for extensions/themes/temp paths (auto-cleaned)
Disabling Core Migrations
If your test doesn't need TI core tables, set $runCoreMigrations = false:
Running Admin Migrations
Admin migrations (orders, menus, locations) are opt-in because some are SQLite-incompatible:
Running Extension Migrations
Traits
TestsMigrations
Migration quality assertions:
TestsTIIntegration
TastyIgniter integration assertions:
MocksTIServices
Pre-built mock factories with sensible defaults:
Dual-Mode Bootstrap
The bootstrap auto-detects the environment:
| Mode | Condition | Use Case |
|---|---|---|
| Host | Parent TI project found (artisan + vendor/tastyigniter/core/) |
Local dev inside a TI app |
| Standalone | No parent TI project | CI pipelines, independent dev |
Both modes use Orchestra Testbench identically. The mode is available via $this->getTestbenchMode() for extensions that need conditional behavior.
Development
License
MIT License. See LICENSE for details.