Flugg\Responder\Tests\Unit\SuccessResponseBuilderTest::transformMethodShouldGetResourceKeyFromModelMethod PHP Méthode

transformMethodShouldGetResourceKeyFromModelMethod() public méthode

Test that you can set a resource key directly on your models by taking use of the [getResourceKey] method.
    public function transformMethodShouldGetResourceKeyFromModelMethod()
    {
        // Arrange...
        $responseBuilder = $this->app->make('responder.success');
        $model = $this->makeModelWithResourceKey('foo');
        // Act...
        $responseBuilder->transform($model);
        // Assert...
        $this->assertEquals($responseBuilder->getResource()->getResourceKey(), 'foo');
    }
SuccessResponseBuilderTest