Completed
Push — master ( 675c2f...342161 )
by Guillem
01:39
created

itThrowAnExceptionOnUnsupportedParameterLocation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace ElevenLabs\Api\Definition;
3
4
use PHPUnit\Framework\TestCase;
5
6
class RequestParameterTest extends TestCase
7
{
8
    /** @test */
9
    public function itThrowAnExceptionOnUnsupportedParameterLocation()
10
    {
11
        $this->expectException(\InvalidArgumentException::class);
12
        $this->expectExceptionMessage(
13
            'nowhere is not a supported parameter location, ' .
14
            'supported: path, header, query, body, formData'
15
        );
16
17
        $param = new Parameter('nowhere', 'foo');
0 ignored issues
show
Unused Code introduced by
The assignment to $param is dead and can be removed.
Loading history...
18
    }
19
20
    /** @test */
21
    public function itCanBeSerialized()
22
    {
23
        $requestParameter = new Parameter('query', 'foo', true, new \stdClass());
24
        $serialized = serialize($requestParameter);
25
26
        assertThat(unserialize($serialized), self::equalTo($requestParameter));
27
        self::assertTrue($requestParameter->hasSchema());
28
    }
29
}
30