I hit this problem and found that documentation on testing is scarce and scattered.
I plan to create PR on that as soon as I get time. So I put here for reference and getting opinion/guidance from Yii community on best way to document it.
Refs:
I've updated docs about that recently. Please check current guide state. It's not at the website yet.
But if you have a way to improve it, let's have it.
Thanks.
I will have a look at the update and see if I have anything to add/improve.
@mtangoo if you need any more references you may also check presentator.io. It is open source and it looks like they have implemented Codeception API tests: https://github.com/ganigeorgiev/presentator/tree/master/api/tests/functional
@tunecino thanks for addition. Their code is quiet great as reference.
I hope to take on this task in few coming days.
I have had lots of problem with c3.php and how to implement it. My tests for api, functional, unit all pass, but my API ones fail when I try to use coverage. Everything centers around c3, unable to be found, uncaught exceptions or just internal server errors.
If there was a clear step by step process of how to ensure coverage works with API that would be good and just a central point for Yii2 and codeception, I find myself between lots of different references and don't know which one is the best most accurate.
I was trying to setup API tests as simple as:
I could not find good monolithic explanations on how to do it all. Morever, the scattered resources hardly helped on (2) and I had to give up for a while writing test to save my face from deadline. I think the tests part is well disorganized than any other part of the documentation. Many stuffs are "hidden" in non-Yii stuffs in Codeception.
I believe that it will be better to move the Testing Documentation into Yii regular documentation and link back the Codeception stuffs. The Yii2 page in codeception will then have simple introduction and the link to latest documentation.
I don't know why Testing and the rest of documentation are separate but I think it is not a good idea to have docs scattered like that!
Sorry for rants.
Most helpful comment
I was trying to setup API tests as simple as:
I could not find good monolithic explanations on how to do it all. Morever, the scattered resources hardly helped on (2) and I had to give up for a while writing test to save my face from deadline. I think the tests part is well disorganized than any other part of the documentation. Many stuffs are "hidden" in non-Yii stuffs in Codeception.
I believe that it will be better to move the Testing Documentation into Yii regular documentation and link back the Codeception stuffs. The Yii2 page in codeception will then have simple introduction and the link to latest documentation.
I don't know why Testing and the rest of documentation are separate but I think it is not a good idea to have docs scattered like that!
Sorry for rants.