Passed
Push — test ( 7f1499...ccf3d3 )
by Someshwer
06:32
created

TestLibrary::testTimezoneRegions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: babi
5
 * Date: 13/6/20
6
 * Time: 11:35 PM
7
 */
8
9
namespace Tests;
10
11
use Someshwer\WorldCountries\Facades\World;
12
13
class TestLibrary extends TestCase
14
{
15
16
    /** @test */
17
    public function testCountries()
18
    {
19
        // Arrange
20
        $countries = World::countries();
0 ignored issues
show
Bug introduced by
The method countries() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        /** @scrutinizer ignore-call */ 
21
        $countries = World::countries();
Loading history...
21
22
        // Assert
23
        $this->assertGreaterThan(count($countries), 200);
24
    }
25
26
    /** @test */
27
    public function testSearchCountry()
28
    {
29
        // Arrange
30
        $country = World::searchCountry('india');
0 ignored issues
show
Bug introduced by
The method searchCountry() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        /** @scrutinizer ignore-call */ 
31
        $country = World::searchCountry('india');
Loading history...
31
32
        // Assert
33
        $this->assertEquals(count($country) , 1);
34
    }
35
36
    /** @test */
37
    public function testCurrencies()
38
    {
39
        // Arrange
40
        $currencies = World::currencies();
0 ignored issues
show
Bug introduced by
The method currencies() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        /** @scrutinizer ignore-call */ 
41
        $currencies = World::currencies();
Loading history...
41
42
        // Assert
43
        $this->assertGreaterThan(30, count($currencies));
44
    }
45
46
    /** @test */
47
    public function testSearchCurrency()
48
    {
49
        // Arrange
50
        $currencies = World::searchCurrency('I');
0 ignored issues
show
Bug introduced by
The method searchCurrency() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

50
        /** @scrutinizer ignore-call */ 
51
        $currencies = World::searchCurrency('I');
Loading history...
51
52
        // Assert
53
        $this->assertGreaterThan(2, count($currencies));
54
    }
55
56
    /** @test */
57
    public function testCurrencyByCountryName()
58
    {
59
        // Arrange
60
        $currency = World::currencyByCountryName('India');
0 ignored issues
show
Bug introduced by
The method currencyByCountryName() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

60
        /** @scrutinizer ignore-call */ 
61
        $currency = World::currencyByCountryName('India');
Loading history...
61
62
        // Assert
63
        $this->assertEquals(1, count($currency));
64
    }
65
66
    /** @test */
67
    public function testCurrencyByCountryCode()
68
    {
69
        // Arrange
70
        $currency = World::currencyByCountryCode('AF');
0 ignored issues
show
Bug introduced by
The method currencyByCountryCode() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

70
        /** @scrutinizer ignore-call */ 
71
        $currency = World::currencyByCountryCode('AF');
Loading history...
71
72
        // Assert
73
        $this->assertGreaterThan(0, count($currency));
74
    }
75
76
    /** @test */
77
    public function testCurrencyByCurrencyName()
78
    {
79
        // Arrange
80
        $currency = World::currencyByCurrencyName('Dollar');
0 ignored issues
show
Bug introduced by
The method currencyByCurrencyName() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

80
        /** @scrutinizer ignore-call */ 
81
        $currency = World::currencyByCurrencyName('Dollar');
Loading history...
81
82
        // Assert
83
        $this->assertGreaterThan(20, count($currency));
84
    }
85
86
    /** @test */
87
    public function testCurrencyByCurrencyCode()
88
    {
89
        // Arrange
90
        $currency = World::currencyByCountryCode('US');
91
92
        // Assert
93
        $this->assertEquals(1, count($currency));
94
    }
95
96
    /** @test */
97
    public function testTimezones()
98
    {
99
        // Arrange
100
        $timezones = World::timezones();
0 ignored issues
show
Bug introduced by
The method timezones() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

100
        /** @scrutinizer ignore-call */ 
101
        $timezones = World::timezones();
Loading history...
101
102
        // Assert
103
        $this->assertGreaterThan(100, count($timezones));
104
    }
105
106
    /** @test */
107
    public function testTimezoneRegions()
108
    {
109
        // Arrange
110
        $timezoneRegions = World::timezoneRegions();
0 ignored issues
show
Bug introduced by
The method timezoneRegions() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

110
        /** @scrutinizer ignore-call */ 
111
        $timezoneRegions = World::timezoneRegions();
Loading history...
111
112
        // Assert
113
        $this->assertGreaterThan(8, count($timezoneRegions));
114
    }
115
116
    /** @test */
117
    public function testTimezonesByRegion()
118
    {
119
        // Arrange
120
        $timezones = World::timezonesByRegion('Antarctica');
0 ignored issues
show
Bug introduced by
The method timezonesByRegion() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

120
        /** @scrutinizer ignore-call */ 
121
        $timezones = World::timezonesByRegion('Antarctica');
Loading history...
121
122
        // Assert
123
        $this->assertGreaterThan(5, count($timezones));
124
    }
125
126
    /** @test */
127
    public function testSearchTimezone()
128
    {
129
        // Arrange
130
        $timezones = World::searchTimezone('UTC');
0 ignored issues
show
Bug introduced by
The method searchTimezone() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

130
        /** @scrutinizer ignore-call */ 
131
        $timezones = World::searchTimezone('UTC');
Loading history...
131
132
        // Assert
133
        $this->assertGreaterThan(0, count($timezones));
134
    }
135
136
    /** @test */
137
    public function testIsoCodes()
138
    {
139
        // Arrange
140
        $isoCodes = World::isoCodes();
0 ignored issues
show
Bug introduced by
The method isoCodes() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

140
        /** @scrutinizer ignore-call */ 
141
        $isoCodes = World::isoCodes();
Loading history...
141
142
        // Assert
143
        $this->assertGreaterThan(100, count($isoCodes));
144
    }
145
146
    /** @test */
147
    public function testRegions()
148
    {
149
        // Arrange
150
        $regions = World::regions();
0 ignored issues
show
Bug introduced by
The method regions() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

150
        /** @scrutinizer ignore-call */ 
151
        $regions = World::regions();
Loading history...
151
152
        // Assert
153
        $this->assertLessThan(11, count($regions));
154
    }
155
156
    /** @test */
157
    public function testSearchIsoCodes()
158
    {
159
        // Arrange
160
        $isoCodes = World::searchIsoCodes('91');
0 ignored issues
show
Bug introduced by
The method searchIsoCodes() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

160
        /** @scrutinizer ignore-call */ 
161
        $isoCodes = World::searchIsoCodes('91');
Loading history...
161
162
        // Assert
163
        $this->assertGreaterThan(1, count($isoCodes));
164
    }
165
166
    /** @test */
167
    public function testIsoInfoByCountryName()
168
    {
169
        // Arrange
170
        $isoInfoByCountryName = World::isoInfoByCountryName('India');
0 ignored issues
show
Bug introduced by
The method isoInfoByCountryName() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

170
        /** @scrutinizer ignore-call */ 
171
        $isoInfoByCountryName = World::isoInfoByCountryName('India');
Loading history...
171
172
        // Assert
173
        $this->assertEquals(0, count($isoInfoByCountryName));
174
    }
175
176
    /** @test */
177
    public function testIsoInfoByCode()
178
    {
179
        // Arrange
180
        $isoInfoByCode = World::isoInfoByCode('IN');
0 ignored issues
show
Bug introduced by
The method isoInfoByCode() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

180
        /** @scrutinizer ignore-call */ 
181
        $isoInfoByCode = World::isoInfoByCode('IN');
Loading history...
181
182
        // Assert
183
        $this->assertEquals($isoInfoByCode->status(), 200);
184
    }
185
186
    /** @test */
187
    public function testIsoCodesByRegion()
188
    {
189
        // Arrange
190
        $isoCodesByRegion = World::isoCodesByRegion('Europe');
0 ignored issues
show
Bug introduced by
The method isoCodesByRegion() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

190
        /** @scrutinizer ignore-call */ 
191
        $isoCodesByRegion = World::isoCodesByRegion('Europe');
Loading history...
191
192
        // Assert
193
        $this->assertGreaterThan(0, count($isoCodesByRegion));
194
    }
195
196
    /** @test */
197
    public function testStates()
198
    {
199
        // Arrange
200
        $states = World::states();
0 ignored issues
show
Bug introduced by
The method states() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

200
        /** @scrutinizer ignore-call */ 
201
        $states = World::states();
Loading history...
201
202
        // Assert
203
        $this->assertGreaterThan(4000, count($states));
204
    }
205
206
    /** @test */
207
    public function testSearchStates()
208
    {
209
        // Arrange
210
        $states = World::searchStates('tel');
0 ignored issues
show
Bug introduced by
The method searchStates() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

210
        /** @scrutinizer ignore-call */ 
211
        $states = World::searchStates('tel');
Loading history...
211
212
        // Assert
213
        $this->assertGreaterThan(5, count($states));
214
    }
215
216
    /** @test */
217
    public function testCountriesForStates()
218
    {
219
        // Arrange
220
        $countriesForStates = World::countriesForStates('UAE');
0 ignored issues
show
Bug introduced by
The method countriesForStates() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

220
        /** @scrutinizer ignore-call */ 
221
        $countriesForStates = World::countriesForStates('UAE');
Loading history...
221
222
        // Assert
223
        $this->assertGreaterThan(200, count($countriesForStates));
224
    }
225
226
    /** @test */
227
    public function testGetStatesByCountry()
228
    {
229
        // Arrange
230
        $states = World::getStatesByCountry('Taiwan');
0 ignored issues
show
Bug introduced by
The method getStatesByCountry() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

230
        /** @scrutinizer ignore-call */ 
231
        $states = World::getStatesByCountry('Taiwan');
Loading history...
231
232
        // Assert
233
        $this->assertGreaterThan(25, count($states));
234
    }
235
236
    /** @test */
237
    public function testStdCodes()
238
    {
239
        // Arrange
240
        $stdCodes = World::stdCodes();
0 ignored issues
show
Bug introduced by
The method stdCodes() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

240
        /** @scrutinizer ignore-call */ 
241
        $stdCodes = World::stdCodes();
Loading history...
241
242
        // Assert
243
        $this->assertGreaterThan(200, count($stdCodes));
244
    }
245
246
    /** @test */
247
    public function testSearchStdCodes()
248
    {
249
        // Arrange
250
        $stdCodes = World::searchStdCodes('44');
0 ignored issues
show
Bug introduced by
The method searchStdCodes() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

250
        /** @scrutinizer ignore-call */ 
251
        $stdCodes = World::searchStdCodes('44');
Loading history...
251
252
        // Assert
253
        $this->assertLessThan(10, count($stdCodes));
254
    }
255
256
    /** @test */
257
    public function testStdCodeByCountryName()
258
    {
259
        // Arrange
260
        $stdCodeByCountryName = World::stdCodeByCountryName('Russia');
0 ignored issues
show
Bug introduced by
The method stdCodeByCountryName() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

260
        /** @scrutinizer ignore-call */ 
261
        $stdCodeByCountryName = World::stdCodeByCountryName('Russia');
Loading history...
261
262
        // Assert
263
        $this->assertEquals(count($stdCodeByCountryName), 1);
264
    }
265
266
    /** @test */
267
    public function testStdCodeByCountryCode()
268
    {
269
        // Arrange
270
        $stdCodeByCountryCode = World::stdCodeByCountryCode('CH');
0 ignored issues
show
Bug introduced by
The method stdCodeByCountryCode() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

270
        /** @scrutinizer ignore-call */ 
271
        $stdCodeByCountryCode = World::stdCodeByCountryCode('CH');
Loading history...
271
272
        // Assert
273
        $this->assertEquals(count($stdCodeByCountryCode), 1);
274
    }
275
276
    /** @test */
277
    public function testCities()
278
    {
279
        // Arrange
280
        $cities = World::cities();
0 ignored issues
show
Bug introduced by
The method cities() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

280
        /** @scrutinizer ignore-call */ 
281
        $cities = World::cities();
Loading history...
281
282
        // Assert
283
        $this->assertGreaterThan(5000, count($cities));
284
    }
285
286
    /** @test */
287
    public function testSearchCities()
288
    {
289
        // Arrange
290
        $cities = World::searchCities('hy');
0 ignored issues
show
Bug introduced by
The method searchCities() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

290
        /** @scrutinizer ignore-call */ 
291
        $cities = World::searchCities('hy');
Loading history...
291
292
        // Assert
293
        $this->assertGreaterThan(15, count($cities));
294
    }
295
296
    /** @test */
297
    public function statesForCities()
298
    {
299
        // Arrange
300
        $statesForCities = World::statesForCities();
0 ignored issues
show
Bug introduced by
The method statesForCities() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

300
        /** @scrutinizer ignore-call */ 
301
        $statesForCities = World::statesForCities();
Loading history...
301
302
        // Assert
303
        $this->assertGreaterThan(4000, count($statesForCities));
304
    }
305
306
    /** @test */
307
    public function countriesForCities()
308
    {
309
        // Arrange
310
        $countriesForCities = World::countriesForCities();
0 ignored issues
show
Bug introduced by
The method countriesForCities() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

310
        /** @scrutinizer ignore-call */ 
311
        $countriesForCities = World::countriesForCities();
Loading history...
311
312
        // Assert
313
        $this->assertGreaterThan(245, count($countriesForCities));
314
    }
315
316
    /** @test */
317
    public function getCitiesByStateName()
318
    {
319
        // Arrange
320
        $city = World::getCitiesByStateName('Karnataka');
0 ignored issues
show
Bug introduced by
The method getCitiesByStateName() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

320
        /** @scrutinizer ignore-call */ 
321
        $city = World::getCitiesByStateName('Karnataka');
Loading history...
321
322
        // Assert
323
        $this->assertGreaterThan(323, count($city));
324
    }
325
326
    /** @test */
327
    public function getCitiesByCountryName()
328
    {
329
        // Arrange
330
        $city = World::getCitiesByCountryName('China');
0 ignored issues
show
Bug introduced by
The method getCitiesByCountryName() does not exist on Someshwer\WorldCountries\Facades\World. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

330
        /** @scrutinizer ignore-call */ 
331
        $city = World::getCitiesByCountryName('China');
Loading history...
331
332
        // Assert
333
        $this->assertGreaterThan(1300, count($city));
334
    }
335
336
}