Skip to content

Commit bc3c306

Browse files
author
Isaac Askew
committed
Adding test to handle non-existence user and improving documentation for logInAs
1 parent 8019f42 commit bc3c306

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Parse/ParseUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public static function logIn($username, $password)
164164
*
165165
* @throws ParseException
166166
*
167-
* @return static
167+
* @return ParseUser
168168
*/
169169
public static function logInAs($userId)
170170
{

tests/Parse/ParseUserTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ public function testLoginAsEmptyUsername()
104104
ParseUser::logInAs('');
105105
}
106106

107+
public function testLoginAsNonexistentUser()
108+
{
109+
$this->expectException('Parse\ParseException', 'user not found.');
110+
ParseUser::logInAs('a1b2c3d4e5');
111+
}
112+
107113
public function testLoginWithFacebook()
108114
{
109115
$this->expectException(

0 commit comments

Comments
 (0)