Summary

Configuring Laravel to create migration files from the existing schemas is also a useful framework for non-greenfield projects. By running both the migrations and seeding in the testing environment, each test can benefit from a completely clean version of the database, and the initial data that allows it to have "just enough" in the database to minimally verify that the software performs as it needs to. When legacy code needs to be ported to Laravel, PHPUnit can be used to test any existing functions. Behat provides a behavioral-based alternative, which can skillfully perform end-to-end testing.

We designed our classes using phpspec in an isolated environment, concentrating only on the business rules and client's requests while mocking things, such as the actual entities, such as rooms. We then verified that the actual queries were executed and saved in the database correctly by the use of a functional testing testing tool, PHPUnit. Finally, we used Behat to perform end-to-end testing.

In the next chapter, we'll see the creation of a RESTful API, the basic CRUD operations (create, read, update, and delete), and discuss some best practices.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset