prepareDatabase([ 'users' => [ $this->normalUser(), ], ]); } /** * @test */ public function user_generates_token() { $response = $this->call($this->controller, null, [], [ 'identification' => 'normal', 'password' => 'too-obscure' ]); $data = json_decode($response->getBody()->getContents(), true); $this->assertEquals(2, $data['userId']); $token = $data['token']; $this->assertEquals(2, AccessToken::findOrFail($token)->user_id); } }