DateTest4GenHour::test_GenHour_Args4()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 28

Duplication

Lines 32
Ratio 100 %

Importance

Changes 4
Bugs 2 Features 1
Metric Value
c 4
b 2
f 1
dl 32
loc 32
rs 8.8571
cc 1
eloc 28
nc 1
nop 0
1
<?php
2
/**
3
 * DateTest4GenHour
4
 *
5
 * Date::GenHour用テストケース
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 DateTest4GenHour extends \PHPUnit_Framework_TestCase
22
{
23
    //------------------------------------------------------//
24
    // テストメソッド定義
25
    //------------------------------------------------------//
26
    /**
27
     * setUp()
28
     *
29
     * テストに必要な準備を実施
30
     */
31
    protected function setUp()
32
    {
33
    }
34
35
    /**
36
     * test_GenHour_NoArgs()
37
     *
38
     * GenHour()の挙動をテストする(引数なし)
39
     */
40
    public function test_GenHour_NoArgs()
41
    {
42
        $want = [
43
            '00' => '00',
44
            '01' => '01',
45
            '02' => '02',
46
            '03' => '03',
47
            '04' => '04',
48
            '05' => '05',
49
            '06' => '06',
50
            '07' => '07',
51
            '08' => '08',
52
            '09' => '09',
53
            '10' => '10',
54
            '11' => '11',
55
            '12' => '12',
56
            '13' => '13',
57
            '14' => '14',
58
            '15' => '15',
59
            '16' => '16',
60
            '17' => '17',
61
            '18' => '18',
62
            '19' => '19',
63
            '20' => '20',
64
            '21' => '21',
65
            '22' => '22',
66
            '23' => '23',
67
        ];
68
69
        $this->assertEquals( Date::genHour(), $want );
70
    }
71
72
    /**
73
     * test_GenHour_Args1()
74
     *
75
     * GenHour()の挙動をテストする(引数1つ)
76
     */
77 View Code Duplication
    public function test_GenHour_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...
78
    {
79
        $want = [
80
            '' => '',
81
            '00' => '00',
82
            '01' => '01',
83
            '02' => '02',
84
            '03' => '03',
85
            '04' => '04',
86
            '05' => '05',
87
            '06' => '06',
88
            '07' => '07',
89
            '08' => '08',
90
            '09' => '09',
91
            '10' => '10',
92
            '11' => '11',
93
            '12' => '12',
94
            '13' => '13',
95
            '14' => '14',
96
            '15' => '15',
97
            '16' => '16',
98
            '17' => '17',
99
            '18' => '18',
100
            '19' => '19',
101
            '20' => '20',
102
            '21' => '21',
103
            '22' => '22',
104
            '23' => '23',
105
        ];
106
107
        $this->assertEquals( Date::genHour( true ), $want );
108
    }
109
110
    /**
111
     * test_GenHour_Args2()
112
     *
113
     * GenHour()の挙動をテストする(引数2つ)
114
     */
115 View Code Duplication
    public function test_GenHour_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...
116
    {
117
        $want = [
118
            '--' => '',
119
            '00' => '00',
120
            '01' => '01',
121
            '02' => '02',
122
            '03' => '03',
123
            '04' => '04',
124
            '05' => '05',
125
            '06' => '06',
126
            '07' => '07',
127
            '08' => '08',
128
            '09' => '09',
129
            '10' => '10',
130
            '11' => '11',
131
            '12' => '12',
132
            '13' => '13',
133
            '14' => '14',
134
            '15' => '15',
135
            '16' => '16',
136
            '17' => '17',
137
            '18' => '18',
138
            '19' => '19',
139
            '20' => '20',
140
            '21' => '21',
141
            '22' => '22',
142
            '23' => '23',
143
        ];
144
145
        $this->assertEquals( Date::genHour( true, '--' ), $want );
146
    }
147
148
    /**
149
     * test_GenHour_Args3()
150
     *
151
     * GenHour()の挙動をテストする(引数3つ)
152
     */
153 View Code Duplication
    public function test_GenHour_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...
154
    {
155
        $want = [
156
            '--' => '--',
157
            '00' => '00',
158
            '01' => '01',
159
            '02' => '02',
160
            '03' => '03',
161
            '04' => '04',
162
            '05' => '05',
163
            '06' => '06',
164
            '07' => '07',
165
            '08' => '08',
166
            '09' => '09',
167
            '10' => '10',
168
            '11' => '11',
169
            '12' => '12',
170
            '13' => '13',
171
            '14' => '14',
172
            '15' => '15',
173
            '16' => '16',
174
            '17' => '17',
175
            '18' => '18',
176
            '19' => '19',
177
            '20' => '20',
178
            '21' => '21',
179
            '22' => '22',
180
            '23' => '23',
181
        ];
182
183
        $this->assertEquals( Date::genHour( true, '--', '--' ), $want );
184
    }
185
186
    /**
187
     * test_GenHour_Args4()
188
     *
189
     * GenHour()の挙動をテストする(引数4つ)
190
     */
191 View Code Duplication
    public function test_GenHour_Args4()
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...
192
    {
193
        $want = [
194
            '--' => '--',
195
            '00' => '午前00',
196
            '01' => '午前01',
197
            '02' => '午前02',
198
            '03' => '午前03',
199
            '04' => '午前04',
200
            '05' => '午前05',
201
            '06' => '午前06',
202
            '07' => '午前07',
203
            '08' => '午前08',
204
            '09' => '午前09',
205
            '10' => '午前10',
206
            '11' => '午前11',
207
            '12' => '午後00',
208
            '13' => '午後01',
209
            '14' => '午後02',
210
            '15' => '午後03',
211
            '16' => '午後04',
212
            '17' => '午後05',
213
            '18' => '午後06',
214
            '19' => '午後07',
215
            '20' => '午後08',
216
            '21' => '午後09',
217
            '22' => '午後10',
218
            '23' => '午後11',
219
        ];
220
221
        $this->assertEquals( Date::genHour( true, '--', '--', false ), $want );
222
    }
223
}