App\Tests\Auth\OAuthServerTest::itRefreshesTheToken PHP Method

itRefreshesTheToken() public method

Once a token is delivered, it can be refreshed by the server.
public itRefreshesTheToken ( )
    public function itRefreshesTheToken()
    {
        DB::table('oauth_clients')->insert(['id' => '12345', 'secret' => '12345', 'name' => 'Testing Env', 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')]);
        $user = factory(User::class)->create();
        $response = $this->post('/api/oauth/authorize', ['grant_type' => 'password', 'client_id' => "12345", 'client_secret' => "12345", 'username' => $user->email, 'password' => "123456789"])->seeStatusCode(200);
        $responseBody = json_decode($response->response->getContent());
        $this->post('/api/oauth/authorize', ['grant_type' => 'refresh_token', 'client_id' => "12345", 'client_secret' => "12345", 'refresh_token' => $responseBody->refresh_token])->seeStatusCode(200);
    }