File tree Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 15
15
->in (__DIR__ )
16
16
->exclude ([
17
17
'src/Core/Bridge/Symfony/Maker/Resources/skeleton ' ,
18
+ 'src/Laravel/config ' ,
18
19
'tests/Fixtures/app/var ' ,
19
20
'docs/guides ' ,
20
21
'docs/var ' ,
Original file line number Diff line number Diff line change 14
14
namespace ApiPlatform \Laravel \Tests ;
15
15
16
16
use ApiPlatform \Laravel \Test \ApiTestAssertionsTrait ;
17
+ use Illuminate \Contracts \Config \Repository ;
18
+ use Illuminate \Foundation \Application ;
17
19
use Illuminate \Foundation \Testing \RefreshDatabase ;
18
20
use Orchestra \Testbench \Concerns \WithWorkbench ;
19
21
use Orchestra \Testbench \TestCase ;
@@ -26,6 +28,16 @@ class JsonApiTest extends TestCase
26
28
use RefreshDatabase;
27
29
use WithWorkbench;
28
30
31
+ /**
32
+ * @param Application $app
33
+ */
34
+ protected function defineEnvironment ($ app ): void
35
+ {
36
+ tap ($ app ['config ' ], function (Repository $ config ): void {
37
+ $ config ->set ('api-platform.formats ' , ['jsonapi ' => ['application/vnd.api+json ' ]]);
38
+ });
39
+ }
40
+
29
41
public function testGetCollection (): void
30
42
{
31
43
$ response = $ this ->get ('/api/books ' , ['accept ' => ['application/vnd.api+json ' ]]);
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- /*
4
- * This file is part of the API Platform project.
5
- *
6
- * (c) Kévin Dunglas <[email protected] >
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- declare (strict_types=1 );
13
-
14
3
return [
15
4
'title ' => 'API Platform ' ,
16
5
'description ' => 'My awesome API ' ,
31
20
32
21
'formats ' => [
33
22
'jsonld ' => ['application/ld+json ' ],
34
- 'jsonapi ' => ['application/vnd.api+json ' ],
23
+ // 'jsonapi' => ['application/vnd.api+json'],
35
24
],
36
25
37
26
'patch_formats ' => [
38
27
'json ' => ['application/merge-patch+json ' ],
39
28
],
40
29
41
30
'docs_formats ' => [
42
- 'jsonopenapi ' => ['application/vnd.openapi+json ' ],
43
- 'json ' => ['application/json ' ],
44
31
'jsonld ' => ['application/ld+json ' ],
32
+ //'jsonapi' => ['application/vnd.api+json'],
33
+ 'jsonopenapi ' => ['application/vnd.openapi+json ' ],
45
34
'html ' => ['text/html ' ],
46
35
],
47
36
You can’t perform that action at this time.
0 commit comments