Skip to content

Commit db3b5e1

Browse files
committed
Issue-230: adding varnish
- fixing dispatch tests
1 parent 1311183 commit db3b5e1

File tree

7 files changed

+8
-42
lines changed

7 files changed

+8
-42
lines changed

dev/tests/integration/testsuite/Magento/Framework/GraphQl/Config/GraphQlReaderTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,7 @@ enumValues(includeDeprecated: true) {
187187
->addHeaders(['Content-Type' => 'application/json']);
188188
$request->setHeaders($headers);
189189

190-
/** @var \Magento\Framework\App\Response\Http $response */
191-
$response = $this->objectManager->create(\Magento\Framework\App\Response\Http::class);
192-
/** @var \Magento\Framework\Controller\Result\Json $result */
193-
$result = $this->graphQlController->dispatch($request);
194-
$result->renderResult($response);
190+
$response = $this->graphQlController->dispatch($request);
195191
$output = $this->jsonSerializer->unserialize($response->getContent());
196192
$expectedOutput = require __DIR__ . '/../_files/schema_response_sdl_description.php';
197193

dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/CategoriesWithProductsCacheTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ public function testToCheckRequestCacheTagsForCategoryWithProducts(): void
9494
$this->request->setPathInfo('/graphql');
9595
$this->request->setMethod('GET');
9696
$this->request->setParams($queryParams);
97-
/** @var \Magento\Framework\Controller\Result\Json $result */
98-
$result = $this->graphqlController->dispatch($this->request);
99-
/** @var \Magento\Framework\App\Response\Http $response */
100-
$response = $this->objectManager->get(\Magento\Framework\App\Response\Http::class);
101-
$result->renderResult($response);
97+
$response = $this->graphqlController->dispatch($this->request);
10298
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
10399
$expectedCacheTags = ['cat_c','cat_c_' . $categoryId,'cat_p','cat_p_' . $product->getId(),'FPC'];
104100
$actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue());

dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/CategoryCacheTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,7 @@ public function testToCheckRequestCacheTagsForForCategory(): void
6262
$this->request->setPathInfo('/graphql');
6363
$this->request->setMethod('GET');
6464
$this->request->setQueryValue('query', $query);
65-
/** @var \Magento\Framework\Controller\Result\Json $result */
66-
$result = $this->graphqlController->dispatch($this->request);
67-
/** @var \Magento\Framework\App\Response\Http $response */
68-
$response = $this->objectManager->get(\Magento\Framework\App\Response\Http::class);
69-
/** @var $registry \Magento\Framework\Registry */
70-
$result->renderResult($response);
65+
$response = $this->graphqlController->dispatch($this->request);
7166
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
7267
$actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue());
7368
$expectedCacheTags = ['cat_c','cat_c_' . $categoryId,'FPC'];

dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/DeepNestedCategoriesAndProductsTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ public function testDispatchForCacheHeadersOnDeepNestedQueries(): void
115115
$this->request->setPathInfo('/graphql');
116116
$this->request->setMethod('GET');
117117
$this->request->setQueryValue('query', $query);
118-
/** @var \Magento\Framework\Controller\Result\Json $result */
119-
$result = $this->graphql->dispatch($this->request);
120-
/** @var \Magento\Framework\App\Response\Http $response */
121-
$response = $this->objectManager->get(\Magento\Framework\App\Response\Http::class);
122-
$result->renderResult($response);
118+
$response = $this->graphql->dispatch($this->request);
123119
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
124120
$actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue());
125121
$this->assertEmpty(

dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Catalog/ProductsCacheTest.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,7 @@ public function testToCheckRequestCacheTagsForProducts(): void
7474
$this->request->setPathInfo('/graphql');
7575
$this->request->setMethod('GET');
7676
$this->request->setQueryValue('query', $query);
77-
/** @var \Magento\Framework\Controller\Result\Json $result */
78-
$result = $this->graphqlController->dispatch($this->request);
79-
/** @var \Magento\Framework\App\Response\Http $response */
80-
$response = $this->objectManager->get(\Magento\Framework\App\Response\Http::class);
81-
/** @var $registry \Magento\Framework\Registry */
82-
$result->renderResult($response);
77+
$response = $this->graphqlController->dispatch($this->request);
8378
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
8479
$actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue());
8580
$expectedCacheTags = ['cat_p', 'cat_p_' . $product->getId(), 'FPC'];
@@ -111,11 +106,7 @@ public function testToCheckRequestNoTagsForProducts(): void
111106
$this->request->setPathInfo('/graphql');
112107
$this->request->setMethod('GET');
113108
$this->request->setQueryValue('query', $query);
114-
/** @var \Magento\Framework\Controller\Result\Json $result */
115-
$result = $this->graphqlController->dispatch($this->request);
116-
/** @var \Magento\Framework\App\Response\Http $response */
117-
$response = $this->objectManager->get(\Magento\Framework\App\Response\Http::class);
118-
$result->renderResult($response);
109+
$response = $this->graphqlController->dispatch($this->request);
119110
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
120111
$actualCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue());
121112
$expectedCacheTags = ['FPC'];

dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Cms/BlockCacheTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@ public function testCmsBlocksRequestHasCorrectTags(): void
6868
$this->request->setPathInfo('/graphql');
6969
$this->request->setMethod('GET');
7070
$this->request->setQueryValue('query', $query);
71-
/** @var \Magento\Framework\Controller\Result\Json $result */
72-
$result = $this->graphqlController->dispatch($this->request);
73-
/** @var \Magento\Framework\App\Response\Http $response */
74-
$response = $this->objectManager->get(\Magento\Framework\App\Response\Http::class);
75-
$result->renderResult($response);
71+
$response = $this->graphqlController->dispatch($this->request);
7672
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
7773
$expectedCacheTags = ['cms_b', 'cms_b_' . $block->getId(), 'cms_b_' . $block->getIdentifier(), 'FPC'];
7874
$rawActualCacheTags = $response->getHeader('X-Magento-Tags')->getFieldValue();

dev/tests/integration/testsuite/Magento/GraphQlCache/Controller/Cms/CmsPageCacheTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ public function testToCheckCmsPageRequestCacheTags(): void
7171
$this->request->setPathInfo('/graphql');
7272
$this->request->setMethod('GET');
7373
$this->request->setQueryValue('query', $query);
74-
/** @var \Magento\Framework\Controller\Result\Json $result */
75-
$result = $this->graphqlController->dispatch($this->request);
76-
/** @var \Magento\Framework\App\Response\Http $response */
77-
$response = $this->objectManager->get(\Magento\Framework\App\Response\Http::class);
78-
$result->renderResult($response);
74+
$response = $this->graphqlController->dispatch($this->request);
7975
$this->assertEquals('MISS', $response->getHeader('X-Magento-Cache-Debug')->getFieldValue());
8076
$requestedCacheTags = explode(',', $response->getHeader('X-Magento-Tags')->getFieldValue());
8177
$expectedCacheTags = ['cms_p', 'cms_p_' .$pageId , 'FPC'];

0 commit comments

Comments
 (0)