Testingmania #1: Unit Testing Laravel Models

Testing that the model has the expected columns

Testing that the model has the expected attributes

Testing the relationships on the model

Testing the methods on the model

The code used for illustration is taken from the OpenLitterMap project. They’re doing a great job creating the world’s most advanced open database on litter, brands & plastic pollution. The project is open-sourced and would love your contributions, both as users and developers.

--

--

Full-stack web developer with a passion for software architecture and cloud computing.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store