DiscussionCountTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Tests\Feature;
  3. use Illuminate\Foundation\Testing\RefreshDatabase;
  4. use Illuminate\Foundation\Testing\WithFaker;
  5. use Tests\TestCase;
  6. class DiscussionCountTest extends TestCase
  7. {
  8. private $token = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJuYmYiOjE2OTc3Mjg2ODUsImV4cCI6MTcyOTI2NDY4NSwidWlkIjoiYmE1NDYzZjMtNzJkMS00NDEwLTg1OGUtZWFkZDEwODg0NzEzIiwiaWQiOjR9.fiXhnY2LczZ9kKVHV0FfD3AJPZt-uqM5wrDe4EhToVexdd007ebPFYssZefmchfL0mx9nF0rgHSqjNhx4P0yDA';
  9. /**
  10. * A basic feature test example.
  11. *
  12. * @return void
  13. */
  14. public function test_example()
  15. {
  16. $response = $this->get('/');
  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/discussion-count',
  25. [
  26. 'course_id'=>'b3145a94-e400-459d-9507-acbb05256e4e',
  27. 'sentences'=>[[168,916,2,9]],
  28. ]);
  29. $response->assertOk();
  30. }
  31. }