"requires no thinking" .. I like that.
Seriously, as an independent, I often find the labour of setting up tests just is often not worth it, when I can user test quickly.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey, all -
Thought I'd show you this thing I'm working on over the weekend. It gives you a much easier way to write integration tests in PHPUnit. While tools like Codeception and Behat exist (and are great), they can sometimes be confusing to setup. But, particularly for Laravel work, this method requires no thinking and is pretty intuitive, in my mind. It's also super super fast.
It's not yet available to use, but will be in a few days. I already have it working locally, so just need to dog food it for a while. But, here's the type of things you'll be able to do:
<?php
class ExampleTest extends IntegrationTest
{
/** test */
function it_verifies_that_pages_load_properly()
{
$this->visit('/');
}
/** test */
function it_follows_links()
{
$this->visit('/page-1')
->click('Follow Me')
->andSee('You are on Page 2')
->onPage('/page-2');
}
/** @test */
function it_submits_forms()
{
$this->visit('page-with-form')
->submitForm('Submit', ['title' => 'Foo Title'])
->andSee('You entered Foo Title')
->onPage('/page-with-form-results');
// Another way to write it.
$this->visit('page-with-form')
->type('Foo Title', '#title')
->press('Submit')
->see('You Entered Foo Title');
}
/** @test */
function it_verifies_information_in_the_database()
{
$this->visit('database-test')
->type('Testing', 'name')
->press('Save to Database')
->verifyInDatabase('things', ['name' => 'Testing']);
}
}
If I can get everything clean enough, we might even be able to get this into Laravel core. We'll see...
Please or to participate in this conversation.