Creating the API suite

In our case, we need unit tests and API tests. Although, we can use the functional tests suite for API tests because these are at the functional testing level but for the sake of clarity and understanding, we can create a separate API suite through this command:

composer exec codecept g:suite api

Here, in this command, g is short for generate and it will generate an API suite. api is just the name of another suite, and this command has created these files and directories:

tests/api/
tests/api.suite.yml
tests/_support/ApiTester.php
tests/_support/Helper/Api.php
tests/_support/_generated/ApiTesterActions.php

The api.suite.yml file will have basic settings without much detail. It is because the api.suite.yml file will have basic settings without much detail. It is because api here is just a name. You could even say:

composer exec codecept g:suite abc

It should have created abc suite with the same file structure and settings. So, our API Suite is just another test suite that we created separately for the sake of clarity and understanding.