diff --git a/config/fractal.php b/config/fractal.php index 19bd0f7..a231c73 100644 --- a/config/fractal.php +++ b/config/fractal.php @@ -62,7 +62,7 @@ * * NOTE: This feature does not work if the "resource name" is not set. */ - 'enabled' => true, + 'enabled' => false, /* * The name of key in the request, where we should look for the fieldsets to parse. diff --git a/tests/AutoFieldsetsTest.php b/tests/AutoFieldsetsTest.php index a479ecf..5a76c97 100644 --- a/tests/AutoFieldsetsTest.php +++ b/tests/AutoFieldsetsTest.php @@ -3,6 +3,7 @@ use Illuminate\Testing\Fluent\AssertableJson; it('returns only requested fields', function ($fields, $expectedMissing) { + config()->set('fractal.auto_fieldsets.enabled', true); $response = $this->call('GET', '/auto-fieldsets-with-resource-name', [ 'fields' => [ 'books' => $fields, @@ -27,6 +28,7 @@ ]); it('doesnt work if "resource name" is not set', function ($fields) { + config()->set('fractal.auto_fieldsets.enabled', true); $response = $this->call('GET', '/auto-fieldsets-without-resource-name', [ 'fields' => [ 'books' => $fields, @@ -50,6 +52,7 @@ ]); it('all fields are present when parameter is not passed', function () { + config()->set('fractal.auto_fieldsets.enabled', true); $response = $this->call('GET', '/auto-fieldsets-with-resource-name', [ 'include' => 'characters', ]); @@ -86,6 +89,7 @@ }); it('uses the configured request key', function () { + config()->set('fractal.auto_fieldsets.enabled', true); config()->set('fractal.auto_fieldsets.request_key', 'other_fields'); $response = $this->call('GET', '/auto-fieldsets-with-resource-name', [ 'fields' => [