Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** @test */
- public function endpoint_shouldReturn200()
- {
- factory(User::class)->create([
- 'email' => 'unique@email.com',
- 'password' => bcrypt('password')
- ]);
- $response = $this->postJson(
- '/api/auth/tokens',
- [
- 'email' => 'unique@email.com',
- 'password' => 'password',
- 'device_name' => 'ios'
- ]
- ); // Issuing a token, expecting 201
- $response->assertStatus(201);
- $token = $response->getData()->data->token;
- $response = $this->deleteJson(
- '/api/auth/tokens',
- [],
- [
- 'Authorization' => "Bearer $token"
- ]
- );
- $response->assertStatus(200);
- $response->assertExactJson([
- 'message' => null,
- 'data' => null
- ]);
- }
Add Comment
Please, Sign In to add comment