Skip to content

PHPUnitTestCaseMethods

Trait for adding PHPUnit 12 compatibility to PhpUnitTestCase

trait PHPUnitTestCaseMethods

SourceTesting/PHPUnitTestCaseMethods.php
MethodDescription
createAttribute(string $name, mixed $value = null): voidCreate attributes for custom annotations
getAnnotations(): array<string, array<string, mixed>>Get test annotations/attributes in a format compatible with both PHPUnit < 10 and >= 10

public function createAttribute(string $name, mixed $value = null): void

Create attributes for custom annotations

The value of the annotation

ParameterTypeDescription
$namestringThe name of the annotation
$valuemixedThe value of the annotation

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