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

addMetaMethodShouldMergeMetaDataWithExisting() public method

Test that the [addMeta] method merges new meta data with existing meta data set on the resource.
    public function addMetaMethodShouldMergeMetaDataWithExisting()
    {
        // Arrange...
        $responseBuilder = $this->app->make('responder.success');
        $meta = ['foo' => 1];
        $moreMeta = ['bar' => 2];
        // Act...
        $responseBuilder->addMeta($meta)->addMeta($moreMeta);
        // Assert...
        $this->assertEquals($responseBuilder->getResource()->getMeta(), array_merge($meta, $moreMeta));
    }
SuccessResponseBuilderTest