grray / laravel-application-testing
Functional testing for laravel like "interacting with your application" in laravel 5.3
Package info
github.com/grray/laravel-application-testing
pkg:composer/grray/laravel-application-testing
dev-master
2021-08-05 02:36 UTC
Requires
- php: >=7.1.3
- symfony/dom-crawler: >=3.1 <6.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-05 13:33:59 UTC
README
Functional testing for laravel 5.7+, perhaps even 5.4+, like "interacting with your application" in laravel 5.3 (copied from it). It can be simpler to use than laravel browser tests, faster to run, and you can use DatabaseTransactions trait on your tests.
How to use
composer require --dev grray/laravel-application-testing
Put into phpunit.xml (in your project root directory) in section <php>
<env name="APP_URL" value="http://localhost"/>
and then put into tests/Feature/HomePageTest.php
<?php
namespace Tests\Feature;
use LaravelApplicationTesting\InteractsWithPages;
use Tests\TestCase;
class HomePageTest extends TestCase
{
use InteractsWithPages;
public function testBasicExample()
{
$this->visit('/')
->click('About Us')
->seePageIs('/about-us');
}
}