PHPUnitTestCaseMethods
Trait for adding PHPUnit 12 compatibility to PhpUnitTestCase
Synopsis
Section titled “Synopsis”trait PHPUnitTestCaseMethods
| Source | Testing/PHPUnitTestCaseMethods.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
createAttribute(string $name, mixed $value = null): void | Create attributes for custom annotations |
getAnnotations(): array<string, array<string, mixed>> | Get test annotations/attributes in a format compatible with both PHPUnit < 10 and >= 10 |
createAttribute()
Section titled “createAttribute()”public function createAttribute(string $name, mixed $value = null): void
Create attributes for custom annotations
The value of the annotation
| Parameter | Type | Description |
|---|---|---|
$name | string | The name of the annotation |
$value | mixed | The value of the annotation |
getAnnotations()
Section titled “getAnnotations()”protected function getAnnotations(): array<string, array<string, mixed>>
Get test annotations/attributes in a format compatible with both PHPUnit < 10 and >= 10
Returns array``<``string``, ``array``<``string``, ``mixed``>``> — The annotations