pbmedia / laravel-browser-kit-macro
A macro to use the Laravel 5.3 testing layer inside your Laravel 5.4+ tests
Fund package maintenance!
pascalbaljet
Installs: 3 529
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 3
Open Issues: 0
Requires
- php: ^8.3 || ^8.2
- illuminate/http: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- laravel/browser-kit-testing: ^7.0
- symfony/dom-crawler: ^6.0
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.4
This package is auto-updated.
Last update: 2024-10-21 11:01:52 UTC
README
This package allows you to seamlessly use the Browser Kit features in more modern Laravel installations.
Requirements
- Laravel 10
- PHP 8.2 or higher
Sponsor Us
❤️ We proudly support the community by developing Laravel packages and giving them away for free. If this package saves you time or if you're relying on it professionally, please consider sponsoring the maintenance and development and check out our latest premium package: Inertia Table. Keeping track of issues and pull requests takes time, but we're happy to help!
Installation
You can install the package via composer:
composer require pbmedia/laravel-browser-kit-macro --dev
If you're not using Package Discovery, add the Service Provider to your config/app.php
file:
ProtoneMedia\LaravelBrowserKitMacro\BrowserKitMacroServiceProvider::class,
Upgrading to v5
- The namespace has changed to
ProtoneMedia\LaravelBrowserKitMacro
. Please update your code accordingly.
Usage
This package adds a browserKit
method to the TestResponse
class. It accepts a Closure which receives the Browser Kit TestCase as its first argument.
/** @test */ public function it_presents_a_registration_form() { $this->get('register') ->assertStatus(200) ->browserKit(function ($test) { $test->seeElement('input', ['name' => 'email']); }); }
Testing
$ composer test
Other Laravel packages
Inertia Table
: The Ultimate Table for Inertia.js with built-in Query Builder.Laravel Blade On Demand
: Laravel package to compile Blade templates in memory.Laravel Cross Eloquent Search
: Laravel package to search through multiple Eloquent models.Laravel Eloquent Scope as Select
: Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes and constraints by adding them as a subquery.Laravel FFMpeg
: This package provides an integration with FFmpeg for Laravel. The storage of the files is handled by Laravel's Filesystem.Laravel MinIO Testing Tools
: Run your tests against a MinIO S3 server.Laravel Mixins
: A collection of Laravel goodies.Laravel Paddle
: Paddle.com API integration for Laravel with support for webhooks/events.Laravel Task Runner
: Write Shell scripts like Blade Components and run them locally or on a remote server.Laravel Verify New Email
: This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.Laravel XSS Protection
: Laravel Middleware to protect your app against Cross-site scripting (XSS). It sanitizes request input, and it can sanatize Blade echo statements.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email code@protone.media instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.