Skip to content

Commit 85126bb

Browse files
committed
B2B-2206: [Spike] Find All Areas in GraphQL That Break When Session is Disabled
1 parent bfe7c94 commit 85126bb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/code/Magento/GraphQl/Plugin/DisableSession.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function __construct(
4747
* @param bool $result
4848
* @return bool
4949
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
50+
* @SuppressWarnings(PHPMD.EmptyCatchBlock)
5051
*/
5152
public function afterCheck(SessionStartChecker $subject, bool $result): bool
5253
{
@@ -57,9 +58,7 @@ public function afterCheck(SessionStartChecker $subject, bool $result): bool
5758
if ($this->appState->getAreaCode() === Area::AREA_GRAPHQL && $this->disableSessionConfig->isDisabled()) {
5859
$result = false;
5960
}
60-
} catch (LocalizedException $e) {
61-
$result = false;
62-
} finally {
61+
} catch (LocalizedException $e) {} finally { //@codingStandardsIgnoreLine
6362
return $result;
6463
}
6564
}

app/code/Magento/GraphQl/Test/Unit/Plugin/DisableSessionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public function testAfterCheckNoArea(bool $config, bool $methodResult, bool $exp
117117
public function testAfterCheckDataProviderNoAreaCode()
118118
{
119119
return [
120-
['config' => true, 'methodResult' => true, 'expected' => false],
120+
['config' => true, 'methodResult' => true, 'expected' => true],
121121
['config' => true, 'methodResult' => false, 'expected' => false],
122-
['config' => false, 'methodResult' => true, 'expected' => false],
122+
['config' => false, 'methodResult' => true, 'expected' => true],
123123
['config' => false, 'methodResult' => false, 'expected' => false],
124124
];
125125
}

0 commit comments

Comments
 (0)