Skip to content

Commit c8879bd

Browse files
committed
test(User): fix auto tests
1 parent 3876853 commit c8879bd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/UserTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,18 @@ public function testSignUpOrLoginByMobilePhone() {
183183

184184
public function testRequestChangePhoneNumber() {
185185
$this->setExpectedException("LeanCloud\CloudException", null, 600);
186-
$user = new User();
187-
$user->setUsername("php_test_change_phone_number");
188-
$user->setPassword("blabla");
189-
$user->signUp();
186+
// Remember to create this user before hand.
187+
User::logIn("php_test_change_phone_number", "blabla");
190188
// phone number is from https://www.yinsiduanxin.com
191189
User::requestChangePhoneNumber("+8616533875941");
192190
}
193191

194192
public function testChangePhoneNumber() {
195193
$this->setExpectedException("LeanCloud\CloudException", null, 603);
196194
User::changePhoneNumber("992989", "+8616533875941");
197-
$user = User::logIn("php_test_change_phone_number", "blabla");
198-
$this->assertEquals("+8616533875941", $user->getMobilePhoneNumber());
199-
$user->destroy();
195+
// Uncomment the follow lines when manually running the test.
196+
// $user = User::logIn("php_test_change_phone_number", "blabla");
197+
// $this->assertEquals("+8616533875941", $user->getMobilePhoneNumber());
200198
}
201199

202200
public function testLogInWithLinkedService() {

0 commit comments

Comments
 (0)