./vendor/autoload.phpbootstrapping file. The framework does not include any code; a configured autoloader should handle including appropriate classes, functions, and constants that tests and code under test might use. Fortunately, Composer makes this pretty easy to do... check out the documentation on Composer autoloading.
#[Test]Attribute. The TestCase provides methods that access the Assertion API. A minimally working example, that compares 2 strings, would look something like the following...
teststhe following command would process
getAsyncIo() : Promise<string>that we want to test.
stringEquals(). This will be resolved by the framework and the resolved value will be what is tested against!
asyncAssert()calls. Let's write a TestCase where we'll ensure that two strings are not equal to one another.
TestCasewill have at least one public method annotated with
TestCasewithout a properly annotated method will result in an error thrown during compilation.
#[Test]that does not assert something, either synchronously or asynchronously, results in a test failure. This can be controlled using the Expectation API.
Cspray\Labrador\AsyncUnit\TestCaseand cannot have a constructor. If something is required that would otherwise be done in a constructor check out the next section for TestCase Hooks.