willThrowAnExceptionIfTheCreatedOnIsMissing()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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 Symfony\Component\Console\Exception\LogicException;
25
26
/**
27
 * Class DnsRecordTest
28
 * @testdox RossMitchell\UpdateCloudFlare\Responses\Results\DnsRecord
29
 * @package RossMitchell\UpdateCloudFlare\Tests\Responses\Results\DnsRecord
30
 */
31
class ThrowExceptionTest extends AbstractClass
32
{
33
    /**
34
     * @test
35
     */
36
    public function willThrowAnExceptionIfTheIdIsMissing(): void
37
    {
38
        $json = $this->getJson();
39
        unset($json->id);
40
        $this->expectException(LogicException::class);
41
        $this->createClass($json);
42
    }
43
44
    /**
45
     * @test
46
     */
47
    public function willThrowAnExceptionIfTheTypeIsMissing(): void
48
    {
49
        $json = $this->getJson();
50
        unset($json->type);
51
        $this->expectException(LogicException::class);
52
        $this->createClass($json);
53
    }
54
55
    /**
56
     * @test
57
     */
58
    public function willThrowAnExceptionIfTheNameIsMissing(): void
59
    {
60
        $json = $this->getJson();
61
        unset($json->name);
62
        $this->expectException(LogicException::class);
63
        $this->createClass($json);
64
    }
65
66
    /**
67
     * @test
68
     */
69
    public function willThrowAnExceptionIfTheContentIsMissing(): void
70
    {
71
        $json = $this->getJson();
72
        unset($json->content);
73
        $this->expectException(LogicException::class);
74
        $this->createClass($json);
75
    }
76
77
    /**
78
     * @test
79
     */
80
    public function willThrowAnExceptionIfTheProxiableIsMissing(): void
81
    {
82
        $json = $this->getJson();
83
        unset($json->proxiable);
84
        $this->expectException(LogicException::class);
85
        $this->createClass($json);
86
    }
87
88
    /**
89
     * @test
90
     */
91
    public function willThrowAnExceptionIfTheProxiedIsMissing(): void
92
    {
93
        $json = $this->getJson();
94
        unset($json->proxied);
95
        $this->expectException(LogicException::class);
96
        $this->createClass($json);
97
    }
98
99
    /**
100
     * @test
101
     */
102
    public function willThrowAnExceptionIfTheTtlIsMissing(): void
103
    {
104
        $json = $this->getJson();
105
        unset($json->ttl);
106
        $this->expectException(LogicException::class);
107
        $this->createClass($json);
108
    }
109
110
    /**
111
     * @test
112
     */
113
    public function willThrowAnExceptionIfTheLockedIsMissing(): void
114
    {
115
        $json = $this->getJson();
116
        unset($json->locked);
117
        $this->expectException(LogicException::class);
118
        $this->createClass($json);
119
    }
120
121
    /**
122
     * @test
123
     */
124
    public function willThrowAnExceptionIfTheZoneIdIsMissing(): void
125
    {
126
        $json = $this->getJson();
127
        unset($json->zone_id);
128
        $this->expectException(LogicException::class);
129
        $this->createClass($json);
130
    }
131
132
    /**
133
     * @test
134
     */
135
    public function willThrowAnExceptionIfTheZoneNameIsMissing(): void
136
    {
137
        $json = $this->getJson();
138
        unset($json->zone_name);
139
        $this->expectException(LogicException::class);
140
        $this->createClass($json);
141
    }
142
143
    /**
144
     * @test
145
     */
146
    public function willThrowAnExceptionIfTheCreatedOnIsMissing(): void
147
    {
148
        $json = $this->getJson();
149
        unset($json->created_on);
150
        $this->expectException(LogicException::class);
151
        $this->createClass($json);
152
    }
153
154
    /**
155
     * @test
156
     */
157
    public function willThrowAnExceptionIfTheModifiedOnIsMissing(): void
158
    {
159
        $json = $this->getJson();
160
        unset($json->modified_on);
161
        $this->expectException(LogicException::class);
162
        $this->createClass($json);
163
    }
164
165
    /**
166
     * @test
167
     */
168
    public function willThrowAnExceptionIfTheDataIsMissing(): void
169
    {
170
        $json = $this->getJson();
171
        unset($json->data);
172
        $this->expectException(LogicException::class);
173
        $this->createClass($json);
174
    }
175
}
176