Skip to content

Commit d5fd098

Browse files
committed
test: various fixes
1 parent 01641cd commit d5fd098

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

features/security/strong_typing.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Feature: Handle properly invalid data submitted to the API
100100
"""
101101
Then the response status code should be 400
102102
And the response should be in JSON
103-
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
103+
And the header "Content-Type" should be equal to "application/problem+json; charset=utf-8"
104104

105105
Scenario: Send non-array data when an array is expected
106106
When I add "Content-Type" header equal to "application/ld+json"

tests/Functional/ItemUriTemplateTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@
1414
namespace ApiPlatform\Tests\Functional;
1515

1616
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
17+
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\Issue6718\Organization;
18+
use ApiPlatform\Tests\SetupClassResourcesTrait;
1719

1820
class ItemUriTemplateTest extends ApiTestCase
1921
{
22+
use SetupClassResourcesTrait;
23+
24+
/**
25+
* @return class-string[]
26+
*/
27+
public static function getResources(): array
28+
{
29+
return [Organization::class];
30+
}
31+
2032
public function testIssue6718(): void
2133
{
2234
self::createClient()->request('GET', '/6718_users/1/organisation', [

tests/Functional/JsonLd.php renamed to tests/Functional/JsonLdTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,22 @@
1616
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
1717
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue6465\Bar;
1818
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue6465\Foo;
19+
use ApiPlatform\Tests\SetupClassResourcesTrait;
1920
use Doctrine\ORM\EntityManagerInterface;
2021
use Doctrine\ORM\Tools\SchemaTool;
2122

22-
class JsonLd extends ApiTestCase
23+
class JsonLdTest extends ApiTestCase
2324
{
25+
use SetupClassResourcesTrait;
26+
27+
/**
28+
* @return class-string[]
29+
*/
30+
public static function getResources(): array
31+
{
32+
return [Foo::class, Bar::class];
33+
}
34+
2435
/**
2536
* The input DTO denormalizes an existing Doctrine entity.
2637
*/

0 commit comments

Comments
 (0)