Write the tests in your own module namespace in a subdirectory like Test/Api
After you copied phpunit.xml.dist
to phpunit.xml
, as described in the docs, change the following:
<!-- Test suites definition -->
<testsuites>
<testsuite name="Magento Web API Functional Tests">
<directory suffix="Test.php">testsuite</directory>
</testsuite>
</testsuites>
to
<!-- Test suites definition -->
<testsuites>
<testsuite name="Your Project Web API Functional Tests">
<directory suffix="Test.php">../../../app/code/*/*/Test/Api</directory>
</testsuite>
</testsuites>
../../../app/code/*/*/Test/Api
is a relative path to your tests. Adjust it if your directory structure differs.
Now running phpunit
within dev/tests/api-functional
runs your own tests instead of the core test suite.