Upgrade BrowserKit Tests to HTTP Tests

The BrowserKit Tests Converter automates the upgrade of your tests using the Laravel 5.3 testing layer (now BrowserKit) to use Laravel's HTTP Tests.

Requirements

A Laravel application running Laravel 5.4 with tests written before Laravel 5.3 or using the Laravel BrowserKit package.

Core Upgrades

The BrowserKit Tests Converter automates many of the upgrades listed in the Laravel Upgrade Guide, including:

  • Adding the new Laravel Tests namespace.
  • Setting up Laravel's new core test classes and traits.
  • Updating phpunit.xml.

Additional Upgrades

In addition to the Core Upgrades, the BrowserKit Tests Converter performs additional upgrade beyond those listed in the Laravel Upgrade Guide, including:

  • Adopting the PSR-2 coding style to match the coding style in Laravel.
  • Converting test methods to the new Laravel versions.
  • Injecting a $response variable into tests previous using the visit() method.
  • Removing references to BrowserKitTestCase.

Manual Upgrades

There are some upgrades the BrowserKit Tests Converter can not perform automatically. When Shift detects these upgrades it adds a detailed comment on the Pull Request to help guide the manual upgrade.

  • Since Laravel 5.4 adds the Tests namespace, references assuming the global namespace will need to be updated.

Still have questions? Message @laravelshift on Twitter or email shift@laravelshift.com.