UnifiedTestCase
in package
implements
IteratorAggregate
Unified test case model class.
This model corresponds to a single test case (i.e. element in "tests" array) within a JSON object conforming to the unified test format's JSON schema. This test case may be executed by UnifiedTestRunner::run().
Tags
Interfaces, Classes, Traits and Enums
- IteratorAggregate
Table of Contents
- $createEntities : array<string|int, mixed>|null
- $initialData : array<string|int, mixed>|null
- $runOnRequirements : array<string|int, mixed>|null
- $schemaVersion : string
- $test : stdClass
- fromFile() : Generator
- Yields UnifiedTestCase objects for a JSON file.
- fromJSON() : Generator
- Yields UnifiedTestCase objects for parsed JSON.
- getIterator() : Traversable
- Return this object as arguments for UnifiedTestRunner::doTestCase().
- __construct() : mixed
Properties
$createEntities
private
array<string|int, mixed>|null
$createEntities
$initialData
private
array<string|int, mixed>|null
$initialData
$runOnRequirements
private
array<string|int, mixed>|null
$runOnRequirements
$schemaVersion
private
string
$schemaVersion
$test
private
stdClass
$test
Methods
fromFile()
Yields UnifiedTestCase objects for a JSON file.
public
static fromFile(string $filename) : Generator
Parameters
- $filename : string
Return values
Generator —fromJSON()
Yields UnifiedTestCase objects for parsed JSON.
public
static fromJSON(stdClass $json) : Generator
The top-level and test-level "description" fields will be concatenated and used as the key for each yielded value.
Parameters
- $json : stdClass
Return values
Generator —getIterator()
Return this object as arguments for UnifiedTestRunner::doTestCase().
public
getIterator() : Traversable
This allows the UnifiedTest object to be used directly with the argument unpacking operator (i.e. "...").
Tags
Return values
Traversable —__construct()
private
__construct(stdClass $test, string $schemaVersion[, array<string|int, mixed>|null $runOnRequirements = null ][, array<string|int, mixed>|null $createEntities = null ][, array<string|int, mixed>|null $initialData = null ]) : mixed
Parameters
- $test : stdClass
- $schemaVersion : string
- $runOnRequirements : array<string|int, mixed>|null = null
- $createEntities : array<string|int, mixed>|null = null
- $initialData : array<string|int, mixed>|null = null