DnsRecordTest::canBeCreatedUsingTheFactory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php declare(strict_types = 1);
2
/**
3
 *
4
 * Copyright (C) 2018  Ross Mitchell
5
 *
6
 * This file is part of RossMitchell/UpdateCloudFlare.
7
 *
8
 * RossMitchell/UpdateCloudFlare is free software: you can redistribute
9
 * it and/or modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
namespace RossMitchell\UpdateCloudFlare\Tests\Responses\Results\DnsRecord;
23
24
use RossMitchell\UpdateCloudFlare\Responses\Results\DnsRecord;
25
26
/**
27
 * Class DnsRecordTest
28
 * @testdox RossMitchell\UpdateCloudFlare\Responses\Results\DnsRecord
29
 * @package RossMitchell\UpdateCloudFlare\Tests\Responses\Results\DnsRecord
30
 */
31
class DnsRecordTest extends AbstractClass
32
{
33
    /**
34
     * @test
35
     */
36
    public function canBeCreatedUsingTheFactory(): void
37
    {
38
        $class = $this->createClass();
39
        $this->assertInstanceOf(DnsRecord::class, $class);
40
    }
41
42
    /**
43
     * @test
44
     */
45
    public function canReturnTheId(): void
46
    {
47
        $class      = $this->createClass();
48
        $expectedId = '372e67954025e0ba6aaa6d586b9e0b59';
49
        $this->assertEquals($expectedId, $class->getId());
50
    }
51
52
    /**
53
     * @test
54
     */
55
    public function canReturnTheType(): void
56
    {
57
        $class    = $this->createClass();
58
        $expected = 'A';
59
        $this->assertEquals($expected, $class->getType());
60
    }
61
62
    /**
63
     * @test
64
     */
65
    public function canReturnTheName(): void
66
    {
67
        $class    = $this->createClass();
68
        $expected = 'example.com';
69
        $this->assertEquals($expected, $class->getName());
70
    }
71
72
    /**
73
     * @test
74
     */
75
    public function canReturnTheContent(): void
76
    {
77
        $class    = $this->createClass();
78
        $expected = '1.2.3.4';
79
        $this->assertEquals($expected, $class->getContent());
80
    }
81
82
    /**
83
     * @test
84
     */
85
    public function canReturnTheProxiable(): void
86
    {
87
        $class = $this->createClass();
88
        $this->assertTrue($class->isProxiable());
89
    }
90
91
    /**
92
     * @test
93
     */
94
    public function canReturnTheProxied(): void
95
    {
96
        $class = $this->createClass();
97
        $this->assertFalse($class->isProxied());
98
    }
99
100
    /**
101
     * @test
102
     */
103
    public function canReturnTheTtl(): void
104
    {
105
        $class    = $this->createClass();
106
        $expected = '120';
107
        $this->assertEquals($expected, $class->getTtl());
108
    }
109
110
    /**
111
     * @test
112
     */
113
    public function canReturnTheLocked(): void
114
    {
115
        $class = $this->createClass();
116
        $this->assertFalse($class->isLocked());
117
    }
118
119
    /**
120
     * @test
121
     */
122
    public function canReturnTheZoneId(): void
123
    {
124
        $class    = $this->createClass();
125
        $expected = '023e105f4ecef8ad9ca31a8372d0c353';
126
        $this->assertEquals($expected, $class->getZoneId());
127
    }
128
129
    /**
130
     * @test
131
     */
132
    public function canReturnTheZoneName(): void
133
    {
134
        $class    = $this->createClass();
135
        $expected = 'example.com';
136
        $this->assertEquals($expected, $class->getZoneName());
137
    }
138
139
    /**
140
     * @test
141
     */
142
    public function canReturnTheCreatedOn(): void
143
    {
144
        $class    = $this->createClass();
145
        $expected = '2014-01-01T05:20:00.12345Z';
146
        $this->assertEquals($expected, $class->getCreatedOn());
147
    }
148
149
    /**
150
     * @test
151
     */
152
    public function canReturnTheModifiedOn(): void
153
    {
154
        $class    = $this->createClass();
155
        $expected = '2014-01-01T05:20:00.12345Z';
156
        $this->assertEquals($expected, $class->getModifiedOn());
157
    }
158
159
    /**
160
     * @test
161
     */
162
    public function canReturnTheData(): void
163
    {
164
        $class = $this->createClass();
165
        $this->assertNull($class->getData());
166
    }
167
}
168