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
|
|
|
} |