<?php
namespace Tests;

use App\User;
use App\Http\Controllers\AuthController;
use Illuminate\Http\Request;

class AuthHelper
{
    private $email = 'jochec.tomas@gmail.com';
    private $password = '12345';

    private function getToken() {
      $authController = new AuthController(new Request());
      $user = User::where('email', $this->email)->first();
      return $authController->jwt($user);
    }

    public function getAuthHeader() {
      return ['HTTP_Authorization' => 'Bearer ' . $this->getToken()];
    }

    public function getEmail() {
      return $this->email;
    }

    public function getPassword() {
      return $this->password;
    }

}
