Skip to content

Commit 8bc6e8d

Browse files
committed
test: only key when value and key are are string in DefinitionNameFactoryTest
1 parent c2b0997 commit 8bc6e8d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/JsonSchema/DefinitionNameFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private function getAttributesAsString(array $attributes): string
125125
$parts[] = $key.'.'.$child;
126126
}
127127
} elseif (\is_string($key)) {
128-
$parts[] = $key.'_'.$value;
128+
$parts[] = $key;
129129
} else {
130130
$parts[] = $value;
131131
}

src/JsonSchema/Tests/DefinitionNameFactoryTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ public static function providerDefinitions(): iterable
8686
yield ['Dummy.jsonhal-title_author.name', Dummy::class, 'jsonhal', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author' => ['name']]]];
8787
yield ['Dummy.jsonld-title_author.name', Dummy::class, 'jsonld', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author' => ['name']]]];
8888

89+
yield ['Dummy-title_author', Dummy::class, 'json', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author' => 'name']]];
90+
yield ['Dummy.jsonapi-title_author', Dummy::class, 'jsonapi', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author' => 'name']]];
91+
yield ['Dummy.jsonhal-title_author', Dummy::class, 'jsonhal', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author' => 'name']]];
92+
yield ['Dummy.jsonld-title_author', Dummy::class, 'jsonld', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author' => 'name']]];
93+
8994
yield ['Dummy-title_author_name', Dummy::class, 'json', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author', 'name']]];
9095
yield ['Dummy.jsonapi-title_author_name', Dummy::class, 'jsonapi', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author', 'name']]];
9196
yield ['Dummy.jsonhal-title_author_name', Dummy::class, 'jsonhal', null, null, [AbstractNormalizer::ATTRIBUTES => ['title', 'author', 'name']]];

0 commit comments

Comments
 (0)