gothinkster / laravel-realworld-example-app

Exemplary real world backend API built with Laravel
https://realworld.io
MIT License
1.2k stars 1.05k forks source link

Adding tests #1

Closed sandeesh closed 7 years ago

sandeesh commented 7 years ago

I have started adding tests to cover all api endpoints. Feel free to create a PR to make a contribution.

MPur commented 7 years ago

I started to implement some tests but what do you think if you have the same structure of postman test ?

Articles/AllArticlesTest.php for Articles -> All articles request Articles/ArticlesByAuthorTest.php for Articles -> Articles by author request ...

sandeesh commented 7 years ago

@MPur thanks for the interest :) Since nobody were willing to help out, i've already completed 90% of the tests and pushed it. You can check them here https://github.com/gothinkster/laravel-realworld-example-app/tree/master/tests/Feature/Api

Only the article tests are pending which i was going to add tomorrow. If you would like to then you can go ahead and finish it. I've kept all the tests related to a particular route in a single file and try to get as many cases possible covered.

I felt the current way more readable and easier to understand. If needed be we can segregate the tests to separate folders and files like you've mentioned after completing all the tests.

sandeesh commented 7 years ago

I've completed adding all the tests myself. Closing this.