在Behat测试中生成Firebase令牌

时间:2018-07-30 13:28:51

标签: php firebase jwt behat api-platform.com

我已经安装了API平台,其中使用Firebase JWT令牌对用户进行了身份验证。

您可以在https://github.com/hpatoio/api-platform-jwt-firebase

看到非常相似的应用程序

我现在想编写一个Behat测试,我需要创建一个有效的JWT令牌以在测试中使用。问题是我无法使用方法描述程序here,因为我的应用程序中没有User

// From the link above

$user = new User(); <<< User are from Firebase in my application
$user->setUsername('admin');
$user->setPassword('ATestPassword');
$user->setEmail('test@test.com');

$this->manager->persist($user);
$this->manager->flush();

$token = $this->jwtManager->create($user);

如何创建可在测试中使用的JWT?

0 个答案:

没有答案