Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

How to send JWT token in $f3->mock() function?

36 views
Skip to first unread message

Morteza Hoseini

unread,
Sep 10, 2024, 2:19:46 AM9/10/24
to Fat-Free Framework
Hi everybody, I'm inexperienced in Testing. I want to Test with the mock() function my fatfree project.

I want to test the routes. based on the F3 document I can use mock().
I try to test a route(get profile info) with the following code.
the response is the user json data if the JWT Token  exist or valid. if not it returns an empty json.
I pass a valid token in $token but it doesn't work, it's like the mock() doesn't get the token.
I'm wonder if there is problem with the mock() or something wrong in my code?

thanks in advance.

$f3->mock('Get /profile/get', array(), ['Authorization' => $token]);
Reply all
Reply to author
Forward
0 new messages