faissaloux/pest-plugin-inside
Pest plugin to run tests from inside your app’s context. Provides helpers to bootstrap Laravel or other frameworks for faster, cleaner integration-style tests without leaving Pest. Simple setup, lightweight, and aimed at improving developer ergonomics.
config/, lang/, or resources/views/ files adhere to naming/convention rules).expect() syntax, which may require developer training but no architectural changes.toReturnLowercase() or toReturnUnique() could over-constrain legitimate use cases (e.g., mixed-case constants in config files). Requires clear documentation of allowed exceptions.expect('directory')->...) could slow CI/CD pipelines if applied to large file trees (e.g., storage/framework/). Mitigation: Limit scope to critical paths (e.g., config/, lang/).toReturnSingleWords() for specific file types)phpunit or custom TestCase traits achieve similar goals with less overhead?config/app.php keys).lang/en/messages.php strings).DatabaseMigrations or DatabaseTransactions).http plugin or Laravel’s HttpTests).file_get_contents() checks).tests/Feature/ExampleTest.php → validate resources/views/example.blade.php).// tests/Feature/TranslationTest.php
expect('lang/en/auth.php')->toReturnLowercase()->toReturnUnique();
storage/logs/).expect('resources/views')->toReturnSingleWords()).composer.json:
"require-dev": {
"faissaloux/pest-plugin-inside": "^1.11.0"
}
pest.php:
uses(Tests\Pest\Plugins\Inside::class)->in('tests');
.env files).composer.json to avoid dependency conflicts.tests/Unit/FileValidationTest.php).depth parameter to control directory scanning granularity.php artisan test --parallel).toValidateLaravelConfig()).expect() syntax and file-scoping rules.README.md or run a lunch-and-learn on file validation patterns.realpath() in tests).tests/README.md).--verbose) to trace file scans.expect('directory')->...) can be CPU-intensive for large trees.
depth: 1).node_modules/, vendor/).--parallel).tests/Validation/ConfigTest.php).storage/framework/cache/).test:unit).| Failure Type | Root Cause | Impact | Mitigation | |---------------------------|
How can I help you explore Laravel packages today?