Completed
Push — master ( ecb243...bb1b22 )
by Pablo
03:58
created

Ipv6Test::itShouldReturnIpv6Address()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace PhpValueObjects\Tests\Network;
5
6
use PhpValueObjects\Tests\BaseUnitTestCase;
7
8 View Code Duplication
final class Ipv6Test extends BaseUnitTestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @test
12
     */
13
    public function itShouldReturnIpv6Address(): void
14
    {
15
        $ipAddress = $this->faker()->ipv6;
16
17
        $ipv6 = new Ipv6($ipAddress);
18
19
        $this->assertSame($ipAddress, $ipv6->value());
20
    }
21
22
    public function invalidIpv6Provider(): array
23
    {
24
        return [
25
            [$this->faker()->ipv4],
26
            [$this->faker()->localIpv4],
27
        ];
28
    }
29
30
    /**
31
     * @test
32
     * @dataProvider invalidIpv6Provider
33
     */
34
    public function itShouldThrowsException(string $data): void
35
    {
36
        $this->expectException(\Exception::class);
37
38
        new Ipv6($data);
39
    }
40
}
41