Skip to content

Commit

Permalink
[Bugfix] Comment out example server registration in config
Browse files Browse the repository at this point in the history
Previously this example prevented a developer from creating a
v1 server after adding Laravel JSON:API to their application.

Closes #3
  • Loading branch information
lindyhopchris committed Jan 31, 2021
1 parent 072344d commit c9a78c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion config/jsonapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
| class name of the server class.
*/
'servers' => [
'v1' => \App\JsonApi\V1\Server::class,
// 'v1' => \App\JsonApi\V1\Server::class,
],
];
11 changes: 3 additions & 8 deletions tests/lib/Integration/Console/MakeServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c9a78c8

Please sign in to comment.