misaf / vendra-testing
Shared testing utilities for Vendra modules
v1.7.1
2026-07-22 21:54 UTC
Requires
- php: ^8.3
- misaf/vendra-support: v1.7.1
- symfony/finder: ^7.4.14
Requires (Dev)
- fakerphp/faker: ^1.24.1
- filament/tables: ^5.0
- larastan/larastan: ^3.10.0
- laravel/boost: ^2.4.12
- laravel/pint: ^1.29.3
- livewire/livewire: ^4.0
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^8.9.4
- orchestra/testbench: ^11.1
- pestphp/pest: ^4.7.5
- pestphp/pest-plugin-arch: ^4.0.2
- pestphp/pest-plugin-laravel: ^4.1
- pestphp/pest-plugin-livewire: ^4.1
- pestphp/pest-plugin-profanity: ^4.2.1
- pestphp/pest-plugin-type-coverage: ^4.0.4
- phpstan/extension-installer: ^1.4.3
README
Shared Pest utilities for Vendra package test suites.
Features
toHaveAtLeastTwoLocales()expectationtoHaveTranslationsInSync()expectationtoHaveSortedTranslationKeys()expectationtoSortByEverySortableColumn()Livewire table expectation- Deterministic translation file and key parity checks
- Provider-neutral tenant helpers that no-op when tenancy is disabled
- User factory helpers resolved from the configured authentication provider
- Tenant-feature and Filament admin test-context helpers
Requirements
- PHP 8.3+
- Laravel 13
- Pest 4
misaf/vendra-support
Installation
composer require --dev misaf/vendra-testing
Composer loads the custom expectations automatically. Use a package language directory as the expectation value:
expect(__DIR__ . '/../../resources/lang') ->toHaveTranslationsInSync('vendra-example') ->toHaveSortedTranslationKeys('vendra-example');
Tenant-aware package tests should use makeCurrentTestTenant(),
switchToTestTenant(), and the related helpers instead of importing the
concrete Vendra Tenant provider.
Use makeCurrentTestTenantWithFeatures() when a test needs deterministic
Pennant state, and setUpFilamentAdminTestContext() to boot a package's
resources in the shared admin-panel test context.
To exercise every sortable table column in both directions:
expect($listPage)->toSortByEverySortableColumn($recordsInAscendingOrder);
Testing
Run the package checks from the package directory:
composer test
composer analyse
License
MIT. See LICENSE.