Skip to content

Commit

Permalink
add condition test
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosen committed Aug 21, 2024
1 parent 3a8cb2d commit e69fa27
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ public function testThunderSearchApi(): void {
];

$result = $this->executeDataProducer('thunder_search_api', $options);

$this->assertEquals(3, $result->total());

/** @var \GraphQL\Deferred $items */
$items = $result->items();
$items->runQueue();
$this->assertEquals('Burda Launches Open-Source CMS Thunder', $items->result[0]->getTitle());
Expand All @@ -61,10 +59,27 @@ public function testThunderSearchApi(): void {

$this->container->get('kernel')->rebuildContainer();
$result = $this->executeDataProducer('thunder_search_api', $options);
/** @var \GraphQL\Deferred $items */

$items = $result->items();
$items->runQueue();
$this->assertEquals('Legal notice', $items->result[0]->getTitle());

// Get articles only

Check failure on line 67 in modules/thunder_gqls/tests/src/Functional/DataProducer/ThunderSearchApiTest.php

View workflow job for this annotation

GitHub Actions / drupal-coder (drupal)

[drupal-coder (drupal)] modules/thunder_gqls/tests/src/Functional/DataProducer/ThunderSearchApiTest.php#L67 <Drupal.Commenting.InlineComment.InvalidEndChar>

Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
Raw output
/github/workspace/modules/thunder_gqls/tests/src/Functional/DataProducer/ThunderSearchApiTest.php:67:5: error: Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses (Drupal.Commenting.InlineComment.InvalidEndChar)
$options['conditions'] = [
[
'field' => 'type',
'value' => 'article',
'operator' => '=',
],
];

$this->container->get('kernel')->rebuildContainer();
$result = $this->executeDataProducer('thunder_search_api', $options);

$items = $result->items();
$items->runQueue();
$this->assertEquals('Come to DrupalCon New Orleans', $items->result[0]->getTitle());

}

}

0 comments on commit e69fa27

Please sign in to comment.