Skip to content

Commit 8a231af

Browse files
committed
fix(tests): fix message and code style (phpstan, phpcs)
1 parent bf21e0b commit 8a231af

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

tests/Fixtures/TestBundle/Entity/PullRequest7135/Bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
operations: [
2525
new Get(
2626
uriTemplate: '/pull-request-7135/bar/{id}',
27-
)
27+
),
2828
]
2929
)]
3030
#[ORM\Table(name: 'bar6466')]

tests/Fixtures/TestBundle/Entity/PullRequest7135/Foo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
operations: [
2525
new Post(
2626
uriTemplate: '/pull-request-7135/foo/',
27-
)
27+
),
2828
],
2929
normalizationContext: ['iri_only' => true],
3030
)]
@@ -38,7 +38,7 @@ class Foo
3838
public Uuid $id;
3939

4040
#[ORM\ManyToOne(targetEntity: Bar::class)]
41-
#[ORM\JoinColumn(referencedColumnName: 'id')]
41+
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
4242
public Bar $bar;
4343

4444
public function __construct()

tests/Functional/PullRequests/PullRequest7135Test.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,34 @@ public static function getResources(): array
3030

3131
public function testValidPostRequestWithIriWhenIdentifierIsUuid(): void
3232
{
33+
$container = static::getContainer();
34+
if ('mongodb' === $container->getParameter('kernel.environment')) {
35+
$this->markTestSkipped();
36+
}
37+
3338
$this->recreateSchema(self::getResources());
3439
$bar = $this->loadFixtures();
3540

3641
$response = self::createClient()->request('POST', '/pull-request-7135/foo/', [
3742
'json' => [
38-
'bar' => 'pull-request-7135/bar/' . $bar->id
39-
]
43+
'bar' => 'pull-request-7135/bar/'.$bar->id
44+
],
4045
]);
4146

4247
self::assertEquals(201, $response->getStatusCode());
4348
}
4449

4550
public function testInvalidPostRequestWithIriWhenIdentifierIsUuid(): void
4651
{
52+
$container = static::getContainer();
53+
if ('mongodb' === $container->getParameter('kernel.environment')) {
54+
$this->markTestSkipped();
55+
}
56+
4757
$response = self::createClient()->request('POST', '/pull-request-7135/foo/', [
4858
'json' => [
4959
'bar' => 'pull-request-7135/bar/invalid-uuid'
50-
]
60+
],
5161
]);
5262

5363
self::assertEquals(400, $response->getStatusCode());
@@ -56,10 +66,15 @@ public function testInvalidPostRequestWithIriWhenIdentifierIsUuid(): void
5666

5767
public function testInvalidGetRequestWhenIdentifierIsUuid(): void
5868
{
69+
$container = static::getContainer();
70+
if ('mongodb' === $container->getParameter('kernel.environment')) {
71+
$this->markTestSkipped();
72+
}
73+
5974
$response = self::createClient()->request('GET', '/pull-request-7135/bar/invalid-uuid');
6075

6176
self::assertEquals(404, $response->getStatusCode());
62-
self::assertJsonContains(['detail' => 'Invalid uri variables.']);
77+
self::assertJsonContains(['detail' => 'Invalid identifier value or configuration.']);
6378
}
6479

6580
protected function loadFixtures(): Bar

0 commit comments

Comments
 (0)