RecentTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Tests\Feature;
  3. use Illuminate\Foundation\Testing\RefreshDatabase;
  4. use Illuminate\Foundation\Testing\WithFaker;
  5. use Tests\TestCase;
  6. class RecentTest extends TestCase
  7. {
  8. private $token = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJuYmYiOjE2NjgyMzE3MTksImV4cCI6MTY5OTc2NzcxOSwidWlkIjoiYmE1NDYzZjMtNzJkMS00NDEwLTg1OGUtZWFkZDEwODg0NzEzIiwiaWQiOiI0In0.LV4ItC5VCqXpbKIXT1zePcnfi-heCf3Df63w7qbXsT1i5KJtwJJC938CLgANjqwcQFa3lrR5TqvT1kkqD-Mmgg';
  9. /**
  10. * A basic feature test example.
  11. *
  12. * @return void
  13. */
  14. public function test_index()
  15. {
  16. $response = $this->get('/api/v2/recent?view=user&id=ba5463f3-72d1-4410-858e-eadd10884713');
  17. $response->assertStatus(200);
  18. }
  19. public function test_store()
  20. {
  21. //testing store
  22. $response = $this->withHeaders([
  23. 'Authorization' => $this->token,
  24. ])->json('POST', '/api/v2/recent',
  25. [
  26. 'type'=>'chapter',
  27. 'article_id'=>'168-3',
  28. 'user_uid'=>'ba5463f3-72d1-4410-858e-eadd10884713',
  29. ]);
  30. $response->assertOk();
  31. }
  32. }