Move all tests to using new TestToken trait

This commit is contained in:
Jonny Barnes 2017-09-19 20:38:45 +01:00
parent 79782caa95
commit 79f6519ce0
3 changed files with 6 additions and 74 deletions

View file

@ -3,13 +3,14 @@
namespace Tests\Feature;
use Tests\TestCase;
use Tests\TestToken;
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Hmac\Sha256;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class OwnYourGramTest extends TestCase
{
use DatabaseTransactions;
use DatabaseTransactions, TestToken;
public function test_ownyourgram_post()
{
@ -40,18 +41,4 @@ class OwnYourGramTest extends TestCase
'instagram_url' => 'https://www.instagram.com/p/BVC_nVTBFfi/'
]);
}
private function getToken()
{
$signer = new Sha256();
$token = (new Builder())
->set('client_id', 'https://ownyourgram.com')
->set('me', config('app.url'))
->set('scope', 'create')
->set('issued_at', time())
->sign($signer, env('APP_KEY'))
->getToken();
return $token;
}
}