ConstraintViolationsTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A itShouldExtendApiServiceError() 0 5 1
A itShouldProvideTheListOfViolations() 0 7 1
1
<?php
2
namespace ElevenLabs\Api\Service\Exception;
3
4
use ElevenLabs\Api\Validator\ConstraintViolation;
5
use PHPUnit\Framework\TestCase;
6
7
class ConstraintViolationsTest extends TestCase
8
{
9
    /** @test */
10
    public function itShouldExtendApiServiceError()
11
    {
12
        $exception = new ConstraintViolations([]);
13
14
        assertThat($exception, isInstanceOf(ApiServiceError::class));
15
    }
16
17
    /** @test */
18
    public function itShouldProvideTheListOfViolations()
19
    {
20
        $violationList = [$this->prophesize(ConstraintViolation::class)->reveal()];
21
22
        $exception = new ConstraintViolations($violationList);
23
24
        assertThat($exception->getViolations(), equalTo($violationList));
25
    }
26
}
27