Skip to content

Commit

Permalink
增加测试用授权方法
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo committed Jul 6, 2022
1 parent 04be314 commit a4eefbc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Testing/UserAuthMockery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);
/**
* This file is part of KnowYourself.
*
* @link https://www.zhiwotansuo.cn
* @document https://github.com/kydever/work-wx-user/blob/main/README.md
* @contact l@hyperf.io
* @license https://github.com/kydever/work-wx-user/blob/main/LICENSE
*/
namespace KY\WorkWxUser\Testing;

use KY\WorkWxUser\UserAuth;

class UserAuthMockery
{
public static function mockToken(int $id): string
{
$userAuth = new UserAuth($id, $id . '_unit');
$userAuth->save();

return $userAuth->getToken();
}
}

0 comments on commit a4eefbc

Please sign in to comment.