ConstraintViolationTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testConstraintViolationToArray() 0 12 1
1
<?php
2
namespace ElevenLabs\Api\Validator;
3
4
use PHPUnit\Framework\TestCase;
5
6
class ConstraintViolationTest extends TestCase
7
{
8
    public function testConstraintViolationToArray()
9
    {
10
        $expectedArray = [
11
            'property' => 'property_one',
12
            'message' => 'a violation message',
13
            'constraint' => 'required',
14
            'location' => 'query'
15
        ];
16
17
        $violation = new ConstraintViolation('property_one', 'a violation message', 'required', 'query');
18
19
        assertEquals($expectedArray, $violation->toArray());
20
    }
21
}
22