在PHP后端使用第三方身份验证在ember-cli中进行测试
I have an app that uses ember-simple-auth for Google authentication. All requests to my PHP backend are authorized with a Google access token, which the backend checks with Google before doing anything else. I understand ember-simple-auth has a testing package, but how would I go about testing this app?
The backend is a part of the app's repository, under app/api/
.
An approach would be to customise the PHP code depending on the environment (importing config/environment.js
), but it's on the backend and it's written in PHP.
我有一个使用ember-simple-auth进行Google身份验证的应用。 对我的PHP后端的所有请求都使用Google访问令牌授权,后端在执行任何其他操作之前会与Google核对。 我理解ember-simple-auth有一个测试包,但是我该如何测试这个应用程序? p>
后端是应用程序存储库的一部分,在 app / api下 /
.
一种方法是根据环境自定义PHP代码(导入 config / environment.js code>),但它是在 后端,它是用PHP编写的。 p>
div>
You don't want your ember cli tests to depend on the backend so you can simply use ember-simple-auth-testing which will give you a readily authenticated session without interacting with the server at all.