Move all tests to using new TestToken trait
This commit is contained in:
parent
79782caa95
commit
79f6519ce0
3 changed files with 6 additions and 74 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue