File tree Expand file tree Collapse file tree 7 files changed +11
-11
lines changed
Test/Unit/ViewModel/Customer
view/frontend/templates/js
lib/internal/Magento/Framework/App/PageCache Expand file tree Collapse file tree 7 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,11 @@ protected function setUp(): void
40
40
}
41
41
42
42
/**
43
- * Test json encode value.
43
+ * Test serialize value.
44
44
*
45
45
* @return void
46
46
*/
47
- public function testJsonEncode (): void
47
+ public function testSerialize (): void
48
48
{
49
49
$ this ->jsonEncoderMock ->expects ($ this ->once ())
50
50
->method ('serialize ' )
@@ -60,7 +60,7 @@ function ($value) {
60
60
'http://example.com/customer/section/load/ '
61
61
]
62
62
),
63
- $ this ->model ->jsonEncode (['http://example.com/customer/section/load/ ' ])
63
+ $ this ->model ->serialize (['http://example.com/customer/section/load/ ' ])
64
64
);
65
65
}
66
66
}
Original file line number Diff line number Diff line change @@ -31,6 +31,6 @@ public function __construct(
31
31
*/
32
32
public function isLoggedIn (): bool |null
33
33
{
34
- return $ this ->httpContext ->getValue (Context::CONTEXT_AUTH );
34
+ return $ this ->httpContext ->getValue (Context::CONTEXT_AUTH ) ?? false ;
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ public function __construct(
24
24
}
25
25
26
26
/**
27
- * Encode the mixed $valueToEncode into the JSON format
27
+ * Encode the mixed $value into the JSON format
28
28
*
29
- * @param mixed $valueToEncode
29
+ * @param mixed $value
30
30
* @return string
31
31
*/
32
- public function jsonEncode ( $ valueToEncode ): string
32
+ public function serialize ( mixed $ value ): string
33
33
{
34
- return $ this ->jsonEncoder ->serialize ($ valueToEncode );
34
+ return $ this ->jsonEncoder ->serialize ($ value );
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ $expirableSectionNames = $block->getExpirableSectionNames();
23
23
"Magento_Customer/js/customer-data": {
24
24
"sectionLoadUrl": "<?= $ block ->escapeJs ($ block ->getCustomerDataUrl ('customer/section/load ' )) ?> ",
25
25
"expirableSectionLifetime": <?= (int )$ block ->getExpirableSectionLifetime () ?> ,
26
- "expirableSectionNames": <?= /* @noEscape */ $ jsonSerializer ->jsonEncode (
26
+ "expirableSectionNames": <?= /* @noEscape */ $ jsonSerializer ->serialize (
27
27
$ expirableSectionNames
28
28
) ?> ,
29
29
"cookieLifeTime": "<?= $ block ->escapeJs ($ block ->getCookieLifeTime ()) ?> ",
Original file line number Diff line number Diff line change 47
47
<preference for =" Magento\PageCache\Model\VclGeneratorInterface" type =" Magento\PageCache\Model\Varnish\VclGenerator" />
48
48
<preference for =" Magento\PageCache\Model\VclTemplateLocatorInterface" type =" Magento\PageCache\Model\Varnish\VclTemplateLocator" />
49
49
<preference for =" Magento\PageCache\Model\Spi\PageCacheTagsPreprocessorInterface" type =" Magento\PageCache\Model\PageCacheTagsPreprocessorComposite" />
50
- <preference for =" Magento\Framework\App\PageCache\IdentifierInterface" type =" Magento\Framework\App\PageCache\Identifier" />
51
50
</config >
Original file line number Diff line number Diff line change 2003
2003
</arguments >
2004
2004
</type >
2005
2005
<preference for =" Magento\Framework\Filter\Input\PurifierInterface" type =" Magento\Framework\Filter\Input\Purifier" />
2006
+ <preference for =" Magento\Framework\App\PageCache\IdentifierInterface" type =" Magento\Framework\App\PageCache\Identifier" />
2006
2007
</config >
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ class Kernel
78
78
* @param \Magento\Framework\Serialize\SerializerInterface|null $serializer
79
79
* @param AppState|null $state
80
80
* @param \Magento\PageCache\Model\Cache\Type|null $fullPageCache
81
- * @param \Magento\Framework\App\PageCache\IdentifierInterface $identifierForSave
81
+ * @param \Magento\Framework\App\PageCache\IdentifierInterface $identifierForSave|null
82
82
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
83
83
*/
84
84
public function __construct (
You can’t perform that action at this time.
0 commit comments