コード例 #1
0
ファイル: LeanUserTest.php プロジェクト: yuzhibiao/php-sdk
 public function testCircularGetCurrentUser()
 {
     // ensure getCurrentUser neither run indefinetely, nor throw maximum
     // function all error
     $avatar = LeanFile::createWithUrl("alice.png", "https://leancloud.cn/favicon.png");
     $user = LeanUser::logIn("alice", "blabla");
     $user->set("avatar", $avatar);
     $user->save();
     $token = LeanUser::getCurrentSessionToken();
     $user->logOut();
     LeanUser::setCurrentSessionToken($token);
     $user2 = LeanUser::getCurrentUser();
     $this->assertEquals($user2->getUsername(), "alice");
 }