Skip to content

Commit a3a1ec5

Browse files
author
Luis
committed
Testing: Pass BlockTest test
1 parent 0b07f8f commit a3a1ec5

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

modules/graphql_core/tests/src/Kernel/Blocks/BlockTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
77
use Drupal\Tests\block\Traits\BlockCreationTrait;
88
use Drupal\Tests\graphql_core\Kernel\GraphQLCoreTestBase;
9+
use Symfony\Component\HttpFoundation\Session\Session;
910

1011
/**
1112
* Test block retrieval via GraphQL.
@@ -36,6 +37,11 @@ class BlockTest extends GraphQLCoreTestBase {
3637
protected function setUp(): void {
3738
parent::setUp();
3839

40+
$request = $this->container->get('request_stack')->getCurrentRequest();
41+
42+
$session = new Session();
43+
$request->setSession($session);
44+
3945
/** @var \Drupal\Core\Extension\ThemeInstallerInterface $themeInstaller */
4046
$themeInstaller = $this->container->get('theme_installer');
4147
$themeInstaller->install(['stark']);
@@ -79,7 +85,7 @@ public function testStaticBlocks() {
7985
'block_content:1',
8086
// @todo Check metatags. Is the config metatag required?
8187
'config:block.block.stark_powered',
82-
]);
88+
])->setCacheMaxAge(0);
8389

8490
$this->assertResults($query, [], [
8591
'route' => [

tests/src/Kernel/Framework/TestFrameworkTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testFieldMock() {
3333
'my_tag',
3434
]);
3535

36-
// @todo
36+
// @todo make this possible when the new version
3737
// $schema = $this->introspect();
3838
// $this->assertArraySubset([
3939
// 'types' => [

tests/src/Traits/QueryResultAssertionTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ abstract protected function defaultCacheTags();
4444
*/
4545
abstract protected function defaultCacheContexts();
4646

47-
4847
/**
4948
* Retrieve the graphql processor.
5049
*
@@ -226,4 +225,5 @@ private function assertResultMetadata(QueryResult $result, CacheableMetadata $ex
226225
$unexpectedTags = array_diff($result->getCacheTags(), $expected->getCacheTags());
227226
$this->assertEmpty($unexpectedTags, 'Unexpected cache tags: ' . implode(', ', $unexpectedTags));
228227
}
228+
229229
}

0 commit comments

Comments
 (0)