Tinkerwell 4 is out now! See what's new or buy now.
Tinkerwell background image
Tinkerwell Logo Tinkerwell
Hey! You are currently looking at the documentation for Tinkerwell 2. The latest version of the documentation is available here.

Testing mode
#

This mode is deprecated and will be removed in Tinkerwell v3

You can switch to the testing mode in Tinkerwell by either pressing Cmd/Ctrl+E or using the menu bar via Tinker Mode -> Testing.

The testing mode allows you to create and write PHPUnit test suites from within Tinkerwell.

Here's what a default test suite might look like:

/**
* Use this test class to easily start writing
* PHPUnit tests.
*/
class Tinkerwell extends Tests\TestCase {
 
use Illuminate\Foundation\Testing\DatabaseTransactions;
 
public function test_it_works() {
$response = $this->get('/');
 
$response->assertStatus(200);
}
 
}

Just like any other Tinkerwell mode, this one allows you to run within your local application context as well as via SSH - making it very easy to quickly write a test for your code. Or if you haven't used PHPUnit before, it's a great way to get started with writing your very first test - without having to setup anything.