Create Unit Test

You may create a new unit test by using the create test CLI command, for example:

apex create test my-package images

This would create a new file at /tests/MyPackage/ImagesTest.php, which will be executed when phpUnit is run. You may develop this class out exactly as you would any phpUnit class plus with the added methods and assertions.

Below is an example PHP class that would be initially generated:

<?php
declare(strict_types = 1);

namespace Tests\MyPackage;

use Apex\App\Sys\Tests\ApexTestCase;

/**
 * Images Test
 */
class ImagesTest extends ApexTestCase
{

    /**
     * Example test
     */
    public function testExample():void
    {
        $this->assertTrue(true);
    }

}