DateTest4genDay::test_genDay_Args2()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 39
Code Lines 35

Duplication

Lines 39
Ratio 100 %

Importance

Changes 2
Bugs 2 Features 1
Metric Value
c 2
b 2
f 1
dl 39
loc 39
rs 8.8571
cc 1
eloc 35
nc 1
nop 0
1
<?php
2
/**
3
 * DateTest4genDay
4
 *
5
 * Date::genDay用テストケース
6
 *
7
 * @package           risoluto
8
 * @author            Risoluto Developers
9
 * @license           http://opensource.org/licenses/bsd-license.php new BSD license
10
 * @copyright     (C) 2008-2015 Risoluto Developers / All Rights Reserved.
11
 */
12
13
//------------------------------------------------------//
14
// 名前空間の定義
15
//------------------------------------------------------//
16
namespace Risoluto;
17
18
//------------------------------------------------------//
19
// テストクラス定義
20
//------------------------------------------------------//
21
class DateTest4genDay extends \PHPUnit_Framework_TestCase
22
{
23
    //------------------------------------------------------//
24
    // テストメソッド定義
25
    //------------------------------------------------------//
26
    /**
27
     * setUp()
28
     *
29
     * テストに必要な準備を実施
30
     */
31
    protected function setUp()
32
    {
33
    }
34
35
    /**
36
     * test_genDay_NoArgs()
37
     *
38
     * genDay()の挙動をテストする(引数なし)
39
     */
40
    public function test_genDay_NoArgs()
41
    {
42
        $want = [
43
            '01' => '01',
44
            '02' => '02',
45
            '03' => '03',
46
            '04' => '04',
47
            '05' => '05',
48
            '06' => '06',
49
            '07' => '07',
50
            '08' => '08',
51
            '09' => '09',
52
            '10' => '10',
53
            '11' => '11',
54
            '12' => '12',
55
            '13' => '13',
56
            '14' => '14',
57
            '15' => '15',
58
            '16' => '16',
59
            '17' => '17',
60
            '18' => '18',
61
            '19' => '19',
62
            '20' => '20',
63
            '21' => '21',
64
            '22' => '22',
65
            '23' => '23',
66
            '24' => '24',
67
            '25' => '25',
68
            '26' => '26',
69
            '27' => '27',
70
            '28' => '28',
71
            '29' => '29',
72
            '30' => '30',
73
            '31' => '31',
74
        ];
75
76
        $this->assertEquals( Date::genDay(), $want );
77
    }
78
79
    /**
80
     * test_genDay_Args1()
81
     *
82
     * GenMonth()の挙動をテストする(引数1つ)
83
     */
84 View Code Duplication
    public function test_genDay_Args1()
0 ignored issues
show
Duplication introduced by
This method 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...
85
    {
86
        $want = [
87
            '' => '',
88
            '01' => '01',
89
            '02' => '02',
90
            '03' => '03',
91
            '04' => '04',
92
            '05' => '05',
93
            '06' => '06',
94
            '07' => '07',
95
            '08' => '08',
96
            '09' => '09',
97
            '10' => '10',
98
            '11' => '11',
99
            '12' => '12',
100
            '13' => '13',
101
            '14' => '14',
102
            '15' => '15',
103
            '16' => '16',
104
            '17' => '17',
105
            '18' => '18',
106
            '19' => '19',
107
            '20' => '20',
108
            '21' => '21',
109
            '22' => '22',
110
            '23' => '23',
111
            '24' => '24',
112
            '25' => '25',
113
            '26' => '26',
114
            '27' => '27',
115
            '28' => '28',
116
            '29' => '29',
117
            '30' => '30',
118
            '31' => '31',
119
        ];
120
121
        $this->assertEquals( Date::genDay( true ), $want );
122
    }
123
124
    /**
125
     * test_genDay_Args2()
126
     *
127
     * GenMonth()の挙動をテストする(引数2つ)
128
     */
129 View Code Duplication
    public function test_genDay_Args2()
0 ignored issues
show
Duplication introduced by
This method 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...
130
    {
131
        $want = [
132
            '--' => '',
133
            '01' => '01',
134
            '02' => '02',
135
            '03' => '03',
136
            '04' => '04',
137
            '05' => '05',
138
            '06' => '06',
139
            '07' => '07',
140
            '08' => '08',
141
            '09' => '09',
142
            '10' => '10',
143
            '11' => '11',
144
            '12' => '12',
145
            '13' => '13',
146
            '14' => '14',
147
            '15' => '15',
148
            '16' => '16',
149
            '17' => '17',
150
            '18' => '18',
151
            '19' => '19',
152
            '20' => '20',
153
            '21' => '21',
154
            '22' => '22',
155
            '23' => '23',
156
            '24' => '24',
157
            '25' => '25',
158
            '26' => '26',
159
            '27' => '27',
160
            '28' => '28',
161
            '29' => '29',
162
            '30' => '30',
163
            '31' => '31',
164
        ];
165
166
        $this->assertEquals( Date::genDay( true, '--' ), $want );
167
    }
168
169
    /**
170
     * test_genDay_Args3()
171
     *
172
     * GenMonth()の挙動をテストする(引数3つ)
173
     */
174 View Code Duplication
    public function test_genDay_Args3()
0 ignored issues
show
Duplication introduced by
This method 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...
175
    {
176
        $want = [
177
            '--' => '--',
178
            '01' => '01',
179
            '02' => '02',
180
            '03' => '03',
181
            '04' => '04',
182
            '05' => '05',
183
            '06' => '06',
184
            '07' => '07',
185
            '08' => '08',
186
            '09' => '09',
187
            '10' => '10',
188
            '11' => '11',
189
            '12' => '12',
190
            '13' => '13',
191
            '14' => '14',
192
            '15' => '15',
193
            '16' => '16',
194
            '17' => '17',
195
            '18' => '18',
196
            '19' => '19',
197
            '20' => '20',
198
            '21' => '21',
199
            '22' => '22',
200
            '23' => '23',
201
            '24' => '24',
202
            '25' => '25',
203
            '26' => '26',
204
            '27' => '27',
205
            '28' => '28',
206
            '29' => '29',
207
            '30' => '30',
208
            '31' => '31',
209
        ];
210
211
        $this->assertEquals( Date::genDay( true, '--', '--' ), $want );
212
    }
213
214
    /**
215
     * test_genDay_Args4_January()
216
     *
217
     * GenMonth()の挙動をテストする(引数4つ)
218
     */
219 View Code Duplication
    public function test_genDay_Args4_January()
0 ignored issues
show
Duplication introduced by
This method 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...
220
    {
221
        $want = [
222
            '--' => '--',
223
            '01' => '01',
224
            '02' => '02',
225
            '03' => '03',
226
            '04' => '04',
227
            '05' => '05',
228
            '06' => '06',
229
            '07' => '07',
230
            '08' => '08',
231
            '09' => '09',
232
            '10' => '10',
233
            '11' => '11',
234
            '12' => '12',
235
            '13' => '13',
236
            '14' => '14',
237
            '15' => '15',
238
            '16' => '16',
239
            '17' => '17',
240
            '18' => '18',
241
            '19' => '19',
242
            '20' => '20',
243
            '21' => '21',
244
            '22' => '22',
245
            '23' => '23',
246
            '24' => '24',
247
            '25' => '25',
248
            '26' => '26',
249
            '27' => '27',
250
            '28' => '28',
251
            '29' => '29',
252
            '30' => '30',
253
            '31' => '31',
254
        ];
255
256
        $this->assertEquals( Date::genDay( true, '--', '--', [ 'month' => 1, 'year' => '' ] ), $want );
257
    }
258
259
    /**
260
     * test_genDay_Args4_February()
261
     *
262
     * GenMonth()の挙動をテストする(引数4つ)
263
     */
264 View Code Duplication
    public function test_genDay_Args4_February()
0 ignored issues
show
Duplication introduced by
This method 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...
265
    {
266
        $want = [
267
            '--' => '--',
268
            '01' => '01',
269
            '02' => '02',
270
            '03' => '03',
271
            '04' => '04',
272
            '05' => '05',
273
            '06' => '06',
274
            '07' => '07',
275
            '08' => '08',
276
            '09' => '09',
277
            '10' => '10',
278
            '11' => '11',
279
            '12' => '12',
280
            '13' => '13',
281
            '14' => '14',
282
            '15' => '15',
283
            '16' => '16',
284
            '17' => '17',
285
            '18' => '18',
286
            '19' => '19',
287
            '20' => '20',
288
            '21' => '21',
289
            '22' => '22',
290
            '23' => '23',
291
            '24' => '24',
292
            '25' => '25',
293
            '26' => '26',
294
            '27' => '27',
295
            '28' => '28',
296
        ];
297
298
        $this->assertEquals( Date::genDay( true, '--', '--', [ 'month' => 2, 'year' => '2014' ] ), $want );
299
    }
300
301
    /**
302
     * test_genDay_Args4_February_LY()
303
     *
304
     * GenMonth()の挙動をテストする(引数4つ)
305
     */
306 View Code Duplication
    public function test_genDay_Args4_February_LY()
0 ignored issues
show
Duplication introduced by
This method 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...
307
    {
308
        $want = [
309
            '--' => '--',
310
            '01' => '01',
311
            '02' => '02',
312
            '03' => '03',
313
            '04' => '04',
314
            '05' => '05',
315
            '06' => '06',
316
            '07' => '07',
317
            '08' => '08',
318
            '09' => '09',
319
            '10' => '10',
320
            '11' => '11',
321
            '12' => '12',
322
            '13' => '13',
323
            '14' => '14',
324
            '15' => '15',
325
            '16' => '16',
326
            '17' => '17',
327
            '18' => '18',
328
            '19' => '19',
329
            '20' => '20',
330
            '21' => '21',
331
            '22' => '22',
332
            '23' => '23',
333
            '24' => '24',
334
            '25' => '25',
335
            '26' => '26',
336
            '27' => '27',
337
            '28' => '28',
338
            '29' => '29',
339
        ];
340
341
        $this->assertEquals( Date::genDay( true, '--', '--', [ 'month' => 2, 'year' => '2012' ] ), $want );
342
    }
343
344
    /**
345
     * test_genDay_Args4_April()
346
     *
347
     * GenMonth()の挙動をテストする(引数3つ)
348
     */
349 View Code Duplication
    public function test_genDay_Args4_April()
0 ignored issues
show
Duplication introduced by
This method 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...
350
    {
351
        $want = [
352
            '--' => '--',
353
            '01' => '01',
354
            '02' => '02',
355
            '03' => '03',
356
            '04' => '04',
357
            '05' => '05',
358
            '06' => '06',
359
            '07' => '07',
360
            '08' => '08',
361
            '09' => '09',
362
            '10' => '10',
363
            '11' => '11',
364
            '12' => '12',
365
            '13' => '13',
366
            '14' => '14',
367
            '15' => '15',
368
            '16' => '16',
369
            '17' => '17',
370
            '18' => '18',
371
            '19' => '19',
372
            '20' => '20',
373
            '21' => '21',
374
            '22' => '22',
375
            '23' => '23',
376
            '24' => '24',
377
            '25' => '25',
378
            '26' => '26',
379
            '27' => '27',
380
            '28' => '28',
381
            '29' => '29',
382
            '30' => '30',
383
        ];
384
385
        $this->assertEquals( Date::genDay( true, '--', '--', [ 'month' => 4, 'year' => '' ] ), $want );
386
    }
387
388
    /**
389
     * test_genDay_Args4_June()
390
     *
391
     * GenMonth()の挙動をテストする(引数3つ)
392
     */
393 View Code Duplication
    public function test_genDay_Args4_June()
0 ignored issues
show
Duplication introduced by
This method 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...
394
    {
395
        $want = [
396
            '--' => '--',
397
            '01' => '01',
398
            '02' => '02',
399
            '03' => '03',
400
            '04' => '04',
401
            '05' => '05',
402
            '06' => '06',
403
            '07' => '07',
404
            '08' => '08',
405
            '09' => '09',
406
            '10' => '10',
407
            '11' => '11',
408
            '12' => '12',
409
            '13' => '13',
410
            '14' => '14',
411
            '15' => '15',
412
            '16' => '16',
413
            '17' => '17',
414
            '18' => '18',
415
            '19' => '19',
416
            '20' => '20',
417
            '21' => '21',
418
            '22' => '22',
419
            '23' => '23',
420
            '24' => '24',
421
            '25' => '25',
422
            '26' => '26',
423
            '27' => '27',
424
            '28' => '28',
425
            '29' => '29',
426
            '30' => '30',
427
        ];
428
429
        $this->assertEquals( Date::genDay( true, '--', '--', [ 'month' => 6, 'year' => '' ] ), $want );
430
    }
431
432
    /**
433
     * test_genDay_Args4_September()
434
     *
435
     * GenMonth()の挙動をテストする(引数3つ)
436
     */
437 View Code Duplication
    public function test_genDay_Args4_September()
0 ignored issues
show
Duplication introduced by
This method 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...
438
    {
439
        $want = [
440
            '--' => '--',
441
            '01' => '01',
442
            '02' => '02',
443
            '03' => '03',
444
            '04' => '04',
445
            '05' => '05',
446
            '06' => '06',
447
            '07' => '07',
448
            '08' => '08',
449
            '09' => '09',
450
            '10' => '10',
451
            '11' => '11',
452
            '12' => '12',
453
            '13' => '13',
454
            '14' => '14',
455
            '15' => '15',
456
            '16' => '16',
457
            '17' => '17',
458
            '18' => '18',
459
            '19' => '19',
460
            '20' => '20',
461
            '21' => '21',
462
            '22' => '22',
463
            '23' => '23',
464
            '24' => '24',
465
            '25' => '25',
466
            '26' => '26',
467
            '27' => '27',
468
            '28' => '28',
469
            '29' => '29',
470
            '30' => '30',
471
        ];
472
473
        $this->assertEquals( Date::genDay( true, '--', '--', [ 'month' => 9, 'year' => '' ] ), $want );
474
    }
475
476
    /**
477
     * test_genDay_Args4_November()
478
     *
479
     * GenMonth()の挙動をテストする(引数3つ)
480
     */
481 View Code Duplication
    public function test_genDay_Args4_November()
0 ignored issues
show
Duplication introduced by
This method 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...
482
    {
483
        $want = [
484
            '--' => '--',
485
            '01' => '01',
486
            '02' => '02',
487
            '03' => '03',
488
            '04' => '04',
489
            '05' => '05',
490
            '06' => '06',
491
            '07' => '07',
492
            '08' => '08',
493
            '09' => '09',
494
            '10' => '10',
495
            '11' => '11',
496
            '12' => '12',
497
            '13' => '13',
498
            '14' => '14',
499
            '15' => '15',
500
            '16' => '16',
501
            '17' => '17',
502
            '18' => '18',
503
            '19' => '19',
504
            '20' => '20',
505
            '21' => '21',
506
            '22' => '22',
507
            '23' => '23',
508
            '24' => '24',
509
            '25' => '25',
510
            '26' => '26',
511
            '27' => '27',
512
            '28' => '28',
513
            '29' => '29',
514
            '30' => '30',
515
        ];
516
517
        $this->assertEquals( Date::genDay( true, '--', '--', [ 'month' => 11, 'year' => '' ] ), $want );
518
    }
519
}