From c9a78c8b7442a36af4b30079bd2c20aed815b246 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Sun, 31 Jan 2021 09:26:18 +0000 Subject: [PATCH] [Bugfix] Comment out example server registration in config Previously this example prevented a developer from creating a v1 server after adding Laravel JSON:API to their application. Closes #3 --- CHANGELOG.md | 7 +++++++ config/jsonapi.php | 2 +- tests/lib/Integration/Console/MakeServerTest.php | 11 +++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8acd919..f5d3624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/). +## Unreleased + +### Fixed +- [#3](https://github.com/laravel-json-api/laravel/issues/3) +Example server registration in the published configuration file prevented developer from creating +a `v1` server after adding this package to their Laravel application. + ## [1.0.0-alpha.1] - 2021-01-25 Initial release. diff --git a/config/jsonapi.php b/config/jsonapi.php index c12b189..00479d8 100644 --- a/config/jsonapi.php +++ b/config/jsonapi.php @@ -27,6 +27,6 @@ | class name of the server class. */ 'servers' => [ - 'v1' => \App\JsonApi\V1\Server::class, +// 'v1' => \App\JsonApi\V1\Server::class, ], ]; diff --git a/tests/lib/Integration/Console/MakeServerTest.php b/tests/lib/Integration/Console/MakeServerTest.php index 9688e72..12a609b 100644 --- a/tests/lib/Integration/Console/MakeServerTest.php +++ b/tests/lib/Integration/Console/MakeServerTest.php @@ -52,19 +52,14 @@ protected function tearDown(): void public function test(): void { - config()->set('jsonapi', [ - 'namespace' => 'JsonApi', - 'servers' => [ - 'v1' => Server::class, - ], - ]); + config()->set('jsonapi', require __DIR__ . '/../../../../config/jsonapi.php'); $result = $this->artisan('jsonapi:server', [ - 'name' => 'v2' + 'name' => 'v1' ]); $this->assertSame(0, $result); - $this->assertServerCreated('JsonApi', 'V2', '/api/v2'); + $this->assertServerCreated('JsonApi', 'V1', '/api/v1'); } public function testWithUri(): void