DEV Community

Discussion on: Stop the pain, upgrade to PHP 7

Collapse
 
daveklotzer profile image
Dave Klotz

as part of a good upgrade path, I assume you have some kind of unit/smoke testing that is being run to iron out the deprecated or obsolete functions, rather than trying to fix this through a trial and error process? is there a framework you can recommend for php testing?

Collapse
 
menjilx profile image
Menj

following

Collapse
 
fishfacemcgee profile image
Brian Graham

When we did our upgrade at work, we ended with a upgrade path along these lines:

  • Set up CI unit-test-running jobs in PHP 5.6 and PHP 7.1
  • Require tests pass in both environments in order for code to be merged
  • Make PHP 7.1 the only version of PHP available on the development team VMs
  • Make PHP 7.1 the only version of PHP available on our staging server
  • Run static analysis against the codebase (Phan and PHPStan are both good options if you can get a 7.x environment running)
  • Extensive manual testing to cover what the automated testing did not
  • Perform the rollout in a way that you can easily roll back if you run into issues.

As far as automated testing tools, PHPUnit is our go-to and we also have acceptance testing via Codeception.

In my experience, if you've been working in PHP 5.6 for a long time, there won't be many compatibility issues in your app code. The bigger risk will be in third party libraries, especially if you haven't been keeping on the bleeding edge with them.