Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
85.71% |
6 / 7 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| GetUuidField | |
85.71% |
6 / 7 |
|
66.67% |
2 / 3 |
3.03 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| assertResponseValue | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Apie\IntegrationTests\Requests\JsonFields; |
| 4 | |
| 5 | use Apie\Core\Identifiers\Uuid; |
| 6 | use PHPUnit\Framework\TestCase; |
| 7 | |
| 8 | class GetUuidField implements JsonSetFieldInterface |
| 9 | { |
| 10 | public function __construct( |
| 11 | private readonly string $name |
| 12 | ) { |
| 13 | } |
| 14 | |
| 15 | public function getName(): string |
| 16 | { |
| 17 | return $this->name; |
| 18 | } |
| 19 | |
| 20 | public function assertResponseValue(mixed $responseValue): void |
| 21 | { |
| 22 | TestCase::assertMatchesRegularExpression( |
| 23 | Uuid::getRegularExpression(), |
| 24 | $responseValue, |
| 25 | 'Field ' . $this->name . ' should be a valid uuid' |
| 26 | ); |
| 27 | } |
| 28 | } |