test_IsLeapYear_ValidArgPart1()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 6
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * ValidateTest4IsLeapYear
4
 *
5
 * Validate::IsLeapYear用テストケース
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 View Code Duplication
class ValidateTest4IsLeapYear extends \PHPUnit_Framework_TestCase
22
{
23
    //------------------------------------------------------//
24
    // テストメソッド定義
25
    //------------------------------------------------------//
26
    /**
27
     * setUp()
28
     *
29
     * テストに必要な準備を実施
30
     */
31
    protected function setUp()
32
    {
33
    }
34
35
    /**
36
     * test_IsLeapYear_InvalidArgPart1()
37
     *
38
     * isLeapYear()の挙動をテストする(数字2桁)
39
     */
40
    public function test_IsLeapYear_InvalidArgPart1()
41
    {
42
        $test = '13';
43
44
        $this->assertFalse( Validate::isLeapYear( $test ) );
45
    }
46
47
    /**
48
     * test_IsLeapYear_InvalidArgPart2()
49
     *
50
     * isLeapYear()の挙動をテストする(英字4桁)
51
     */
52
    public function test_IsLeapYear_InvalidArgPart2()
53
    {
54
        $test = 'AAAA';
55
56
        $this->assertFalse( Validate::isLeapYear( $test ) );
57
    }
58
59
    /**
60
     * test_IsLeapYear_ValidArgPart1()
61
     *
62
     * isLeapYear()の挙動をテストする(閏年である)
63
     */
64
    public function test_IsLeapYear_ValidArgPart1()
65
    {
66
        $test = '2000';
67
68
        $this->assertTrue( Validate::isLeapYear( $test ) );
69
    }
70
71
    /**
72
     * test_IsLeapYear_ValidArgPart2()
73
     *
74
     * isLeapYear()の挙動をテストする(閏年でない)
75
     */
76
    public function test_IsLeapYear_ValidArgPart2()
77
    {
78
        $test = '2013';
79
80
        $this->assertFalse( Validate::isLeapYear( $test ) );
81
    }
82
}