dotMailer-API-v2-PHP-client
dotMailer-API-v2-PHP-client copied to clipboard
Add unit/functional tests
most of the issues we found so far was due to zero unit tests coverage, can be also some sort of functional tests
Hi @ishakuta, which approach/tools do you suggest for testing?
Hi @Zifius, phpunit with client mock to check different use cases
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 :)