testConstraintViolationToArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 12
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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