Skip to content

Commit dfbd488

Browse files
authored
Fix test fails after data producer parameter adjustment. (#856)
1 parent 6409301 commit dfbd488

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/Plugin/GraphQL/DataProducer/Entity/EntityLoadByUuid.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
/**
1616
* @DataProducer(
1717
* id = "entity_load_by_uuid",
18-
* name = @Translation("Load entity by Uuid"),
19-
* description = @Translation("Loads a single entity by Uuid."),
18+
* name = @Translation("Load entity by uuid"),
19+
* description = @Translation("Loads a single entity by uuid."),
2020
* produces = @ContextDefinition("entity",
2121
* label = @Translation("Entity")
2222
* ),
@@ -32,7 +32,7 @@
3232
* multiple = TRUE,
3333
* required = FALSE
3434
* ),
35-
* "bundle" = @ContextDefinition("string",
35+
* "bundles" = @ContextDefinition("string",
3636
* label = @Translation("Entity bundle(s)"),
3737
* multiple = TRUE,
3838
* required = FALSE
@@ -120,7 +120,7 @@ public function __construct(
120120
*
121121
* @return \GraphQL\Deferred
122122
*/
123-
public function resolve($type, $uuid, $language = NULL, $bundles = [], FieldContext $context) {
123+
public function resolve($type, $uuid, $language = NULL, $bundles = NULL, FieldContext $context) {
124124
$resolver = $this->entityBuffer->add($type, $uuid);
125125

126126
return new Deferred(function () use ($type, $language, $bundles, $resolver, $context) {

src/Plugin/GraphQL/DataProducer/Entity/EntityLoadMultiple.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* "type" = @ContextDefinition("string",
2525
* label = @Translation("Entity type")
2626
* ),
27-
* "ids" = @ContextDefinition("any",
27+
* "ids" = @ContextDefinition("string",
2828
* label = @Translation("Identifier"),
2929
* multiple = TRUE
3030
* ),
@@ -33,7 +33,7 @@
3333
* multiple = TRUE,
3434
* required = FALSE
3535
* ),
36-
* "bundles" = @ContextDefinition("any",
36+
* "bundles" = @ContextDefinition("string",
3737
* label = @Translation("Entity bundle(s)"),
3838
* multiple = TRUE,
3939
* required = FALSE

tests/src/Kernel/DataProducer/EntityMultipleTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ public function setUp() {
8989
*/
9090
public function testResolveEntityLoadMultiple() {
9191
$result = $this->executeDataProducer('entity_load_multiple', [
92-
'entity_type' => $this->node1->getEntityTypeId(),
93-
'entity_bundle' => [$this->node1->bundle(), $this->node2->bundle()],
94-
'entity_ids' => [$this->node1->id(), $this->node2->id(), $this->node3->id()],
92+
'type' => $this->node1->getEntityTypeId(),
93+
'bundles' => [$this->node1->bundle(), $this->node2->bundle()],
94+
'ids' => [$this->node1->id(), $this->node2->id(), $this->node3->id()],
9595
]);
9696

9797
$nids = array_values(array_map(function (NodeInterface $item) {

0 commit comments

Comments
 (0)