You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
658 B

10 years ago
10 years ago
10 years ago
  1. <?php
  2. class ExampleTest extends TestCase
  3. {
  4. public function testHomePageLoads()
  5. {
  6. $response = $this->request('GET', '/');
  7. $this->assertSame(200, $response->getStatusCode());
  8. $this->assertStringContainsString('Compass', $response->getContent());
  9. }
  10. public function testApiInputRequiresToken()
  11. {
  12. $response = $this->request('GET', '/api/input');
  13. $this->assertSame(200, $response->getStatusCode());
  14. $this->assertSame('application/json', $response->headers->get('Content-Type'));
  15. $this->assertSame(['error' => 'no token provided'], json_decode($response->getContent(), true));
  16. }
  17. }