Completed
Push — master ( cec1cf...f9a404 )
by Javi
03:27
created

testConstructorAllAssignments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 0
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace erasys\OpenApi\Tests\Spec;
4
5
use erasys\OpenApi\Spec\v3\ExtensibleInterface;
6
use erasys\OpenApi\Spec\v3\ServerVariable;
7
use PHPUnit\Framework\TestCase;
8
9
class ServerVariableUnitTest extends TestCase
10
{
11
    public function testConstructorRequiredAssignments()
12
    {
13
        $default = 'foo';
14
15
        $obj = new ServerVariable($default);
16
17
        $this->assertInstanceOf(ExtensibleInterface::class, $obj);
18
        $this->assertEquals($default, $obj->default);
19
        $this->assertNull($obj->description);
20
    }
21
22
    public function testConstructorAllAssignments()
23
    {
24
        $default     = 'foo';
25
        $description = 'Lorem ipsum dolor sit amet';
26
        $enum        = [];
27
        $additional  = [
28
            'description' => null,
29
        ];
30
31
        $obj = new ServerVariable($default, $description, $enum, $additional);
32
33
        $this->assertInstanceOf(ExtensibleInterface::class, $obj);
34
        $this->assertEquals($default, $obj->default);
35
        $this->assertEquals($description, $obj->description);
36
        $this->assertEquals($enum, $obj->enum);
37
    }
38
}
39