@@ -34,13 +34,15 @@ public function testValidateUsername()
34
34
35
35
public function testValidateUsernameEmpty ()
36
36
{
37
- $ this ->setExpectedException ('Exception ' , 'The username can not be empty. ' );
37
+ $ this ->expectException ('Exception ' );
38
+ $ this ->expectExceptionMessage ('The username can not be empty. ' );
38
39
$ this ->object ->validateUsername (null );
39
40
}
40
41
41
42
public function testValidateUsernameInvalid ()
42
43
{
43
- $ this ->setExpectedException ('Exception ' , 'The username must contain only lowercase latin characters and underscores. ' );
44
+ $ this ->expectException ('Exception ' );
45
+ $ this ->expectExceptionMessage ('The username must contain only lowercase latin characters and underscores. ' );
44
46
$ this ->object ->validateUsername ('INVALID ' );
45
47
}
46
48
@@ -53,13 +55,15 @@ public function testValidatePassword()
53
55
54
56
public function testValidatePasswordEmpty ()
55
57
{
56
- $ this ->setExpectedException ('Exception ' , 'The password can not be empty. ' );
58
+ $ this ->expectException ('Exception ' );
59
+ $ this ->expectExceptionMessage ('The password can not be empty. ' );
57
60
$ this ->object ->validatePassword (null );
58
61
}
59
62
60
63
public function testValidatePasswordInvalid ()
61
64
{
62
- $ this ->setExpectedException ('Exception ' , 'The password must be at least 6 characters long. ' );
65
+ $ this ->expectException ('Exception ' );
66
+ $ this ->expectExceptionMessage ('The password must be at least 6 characters long. ' );
63
67
$ this ->object ->validatePassword ('12345 ' );
64
68
}
65
69
@@ -72,13 +76,15 @@ public function testValidateEmail()
72
76
73
77
public function testValidateEmailEmpty ()
74
78
{
75
- $ this ->setExpectedException ('Exception ' , 'The email can not be empty. ' );
79
+ $ this ->expectException ('Exception ' );
80
+ $ this ->expectExceptionMessage ('The email can not be empty. ' );
76
81
$ this ->object ->validateEmail (null );
77
82
}
78
83
79
84
public function testValidateEmailInvalid ()
80
85
{
81
- $ this ->setExpectedException ('Exception ' , 'The email should look like a real email. ' );
86
+ $ this ->expectException ('Exception ' );
87
+ $ this ->expectExceptionMessage ('The email should look like a real email. ' );
82
88
$ this ->object ->validateEmail ('invalid ' );
83
89
}
84
90
@@ -91,7 +97,8 @@ public function testValidateFullName()
91
97
92
98
public function testValidateEmailFullName ()
93
99
{
94
- $ this ->setExpectedException ('Exception ' , 'The full name can not be empty. ' );
100
+ $ this ->expectException ('Exception ' );
101
+ $ this ->expectExceptionMessage ('The full name can not be empty. ' );
95
102
$ this ->object ->validateFullName (null );
96
103
}
97
104
}
0 commit comments