dotMailer-API-v2-PHP-client icon indicating copy to clipboard operation
dotMailer-API-v2-PHP-client copied to clipboard

Add unit/functional tests

Open ishakuta opened this issue 9 years ago • 3 comments

most of the issues we found so far was due to zero unit tests coverage, can be also some sort of functional tests

ishakuta avatar Jun 10 '15 21:06 ishakuta

Hi @ishakuta, which approach/tools do you suggest for testing?

Zifius avatar Sep 09 '15 13:09 Zifius

Hi @Zifius, phpunit with client mock to check different use cases

ishakuta avatar Sep 09 '15 19:09 ishakuta

I've started adding some tests into the devel/tests branch. For now, I'm focusing on testing the data types against the wadl specification. My idea is to have an abstract test (e.g. EnumTest) and then inherit specific tests (e.g. ApiAddressBookVisibilityTest, ApiSurveyStateTest) which would only serve the purpose of adding the correct class name and coverage information. The inherited classes can IMHO be generated and then (if needed) specific tests can be added to them. I've added this (into the phpunit.xml) as a separate testsuite (separated from future Resources testing) as it doesn't require a client.

I believe that writing a mock client would be too much work, although generating one from the wadl shouldn't be a problem.

CC @Zifius, @ishakuta: I'd very much appreciate your comments (critique, hints, recommendations...) on the new branch as I'm not skilled in testing.

PS Thank you for caring and participating :)

romanpitak avatar Sep 17 '15 16:09 romanpitak