Unit Test

Unit tests allow you to execute automated tests before publishing a package or upgrade, helping ensure it doesn't contain any bugs. You may create a new unit test by using the create test CLI command, such as:

apex create test <PACKAGE> <ALIAS>

apex create test my-shop orders

Using the above example, this will create a file at /tests/MyShop/OrdersTest.php, which only contains one example method.

This class extends the ApexTestCase class which in turn does extend phpUnit's TestCase class, meaning all of phpUnit's functionality is available within the unit tests.

For full information on conducting unit tests within Apex, please visit the Unit Tests section of the documentation.