Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.24k stars 2.72k forks source link

Tests for REST API and web interface. #14295

Open dpriskorn opened 4 years ago

dpriskorn commented 4 years ago

Feature Request

Dolibarr has a lot of bugs IMO that could be easily discovered before releases if we had some kind of testing suite. I suggest we make one. I can contribute tests, but I have never written tests in PHP before. I could write some in Python to test the API.

Suggested implementation

no idea, never done this before see https://www.tutorialspoint.com/software_testing_dictionary/api_testing.htm and https://www.tutorialspoint.com/software_testing_dictionary/agile_testing.htm

Suggested steps

write tests for the api endpoints write tests that run in the browser/webui

eldy commented 4 years ago

Request is to add more file test/phpunit/RestAPIXXXTest.php

for XXX = contact, thirdparty, ...

How: To write test for API endpoint, you can follow the example of unit test that already exists for API endpoints. For example: the file test/phpunit/RestAPIUserTest.php A copy and paste of file into another file, then editing content is enough to have the test included into existing Continuous Integration