Flugg\Responder\Tests\Unit\SuccessResponseBuilderTest::respondMethodShouldAllowSettingHeaders PHP Method

respondMethodShouldAllowSettingHeaders() public method

Test that you can set any headers to the JSON response by passing a second argument to the [respond] method.
    public function respondMethodShouldAllowSettingHeaders()
    {
        // Arrange...
        $responseBuilder = $this->app->make('responder.success');
        // Act...
        $response = $responseBuilder->respond(201, ['x-foo' => true]);
        // Assert...
        $this->assertArrayHasKey('x-foo', $response->headers->all());
    }
SuccessResponseBuilderTest