test_IsEmailAddr_InvalidTextPart2()   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
 * ValidateTest4IsEmailAddr
4
 *
5
 * Validate4IsEmailAddr用テストケース
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 ValidateTest4IsEmailAddr extends \PHPUnit_Framework_TestCase
22
{
23
    //------------------------------------------------------//
24
    // テストメソッド定義
25
    //------------------------------------------------------//
26
    /**
27
     * setUp()
28
     *
29
     * テストに必要な準備を実施
30
     */
31
    protected function setUp()
32
    {
33
    }
34
35
    /**
36
     * test_IsEmailAddr_InvalidTextPart1()
37
     *
38
     * isEmailAddr()の挙動をテストする(メールアドレスじゃない文字列その1)
39
     */
40
    public function test_IsEmailAddr_InvalidTextPart1()
41
    {
42
        $test = '@risoluto This is test!';
43
44
        $this->assertFalse( Validate::isEmailAddr( $test ) );
45
    }
46
47
    /**
48
     * test_IsEmailAddr_InvalidText()
49
     *
50
     * isEmailAddr()の挙動をテストする(メールアドレスじゃない文字列その2)
51
     */
52
    public function test_IsEmailAddr_InvalidTextPart2()
53
    {
54
        $test = 'test+test-test.test@risoluto_test-test+test.jp';
55
56
        $this->assertFalse( Validate::isEmailAddr( $test ) );
57
    }
58
59
    /**
60
     * test_IsEmailAddr_ValidTextPart1()
61
     *
62
     * isEmailAddr()の挙動をテストする(メールアドレスな文字列その1)
63
     */
64
    public function test_IsEmailAddr_ValidTextPart1()
65
    {
66
        $test = '[email protected]';
67
68
        $this->assertTrue( Validate::isEmailAddr( $test ) );
69
    }
70
71
    /**
72
     * test_IsEmailAddr_ValidTextPart2()
73
     *
74
     * isEmailAddr()の挙動をテストする(メールアドレスな文字列その2)
75
     */
76
    public function test_IsEmailAddr_ValidTextPart2()
77
    {
78
        $test = '[email protected]';
79
80
        $this->assertTrue( Validate::isEmailAddr( $test ) );
81
    }
82
}