@@ -34,13 +34,15 @@ public function testValidateUsername()
3434
3535 public function testValidateUsernameEmpty ()
3636 {
37- $ this ->setExpectedException ('Exception ' , 'The username can not be empty. ' );
37+ $ this ->expectException ('Exception ' );
38+ $ this ->expectExceptionMessage ('The username can not be empty. ' );
3839 $ this ->object ->validateUsername (null );
3940 }
4041
4142 public function testValidateUsernameInvalid ()
4243 {
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. ' );
4446 $ this ->object ->validateUsername ('INVALID ' );
4547 }
4648
@@ -53,13 +55,15 @@ public function testValidatePassword()
5355
5456 public function testValidatePasswordEmpty ()
5557 {
56- $ this ->setExpectedException ('Exception ' , 'The password can not be empty. ' );
58+ $ this ->expectException ('Exception ' );
59+ $ this ->expectExceptionMessage ('The password can not be empty. ' );
5760 $ this ->object ->validatePassword (null );
5861 }
5962
6063 public function testValidatePasswordInvalid ()
6164 {
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. ' );
6367 $ this ->object ->validatePassword ('12345 ' );
6468 }
6569
@@ -72,13 +76,15 @@ public function testValidateEmail()
7276
7377 public function testValidateEmailEmpty ()
7478 {
75- $ this ->setExpectedException ('Exception ' , 'The email can not be empty. ' );
79+ $ this ->expectException ('Exception ' );
80+ $ this ->expectExceptionMessage ('The email can not be empty. ' );
7681 $ this ->object ->validateEmail (null );
7782 }
7883
7984 public function testValidateEmailInvalid ()
8085 {
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. ' );
8288 $ this ->object ->validateEmail ('invalid ' );
8389 }
8490
@@ -91,7 +97,8 @@ public function testValidateFullName()
9197
9298 public function testValidateEmailFullName ()
9399 {
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. ' );
95102 $ this ->object ->validateFullName (null );
96103 }
97104}
0 commit comments