Skip to content
Snippets Groups Projects
Select Git revision
  • f1469c6034fcf8d32901f72b4cbec20e59c25d0b
  • main default protected
  • register-logging-channel
  • expr-lang
  • ci-82
  • attr-events
  • locale-wip
  • custom-routes
  • v0.1.85
  • v0.1.84
  • v0.1.83
  • v0.1.82
  • v0.1.81
  • v0.1.80
  • v0.1.79
  • v0.1.78
  • v0.1.77
  • v0.1.76
  • v0.1.75
  • v0.1.74
  • v0.1.73
  • v0.1.72
  • v0.1.71
  • v0.1.70
  • v0.1.69
  • v0.1.68
  • v0.1.67
  • v0.1.65
28 results

ApiTest.php

Blame
  • ApiTest.php 839 B
    <?php
    
    declare(strict_types=1);
    
    namespace Dbp\Relay\CoreBundle\Tests;
    
    use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase;
    use Dbp\Relay\CoreBundle\TestUtils\UserAuthTrait;
    use Symfony\Component\HttpFoundation\Response;
    
    class ApiTest extends ApiTestCase
    {
        use UserAuthTrait;
    
        public function testIndex()
        {
            $client = $this->withUser('foobar');
            $response = $client->request('GET', '/');
            $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
        }
    
        public function testJSONLD()
        {
            $client = $this->withUser('foobar');
            $response = $client->request('GET', '/', ['headers' => ['HTTP_ACCEPT' => 'application/ld+json']]);
            $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
            $this->assertJson($response->getContent(false));
        }
    }