Skip to content

Commit c711c90

Browse files
committed
ACP2E-4149: Header Login/Logout Not Updating in Multi-Store Setup with Shared Cookies
1 parent 2ee7278 commit c711c90

File tree

1 file changed

+29
-0
lines changed
  • app/code/Magento/Customer/Test/Unit/ViewModel/Customer

1 file changed

+29
-0
lines changed

app/code/Magento/Customer/Test/Unit/ViewModel/Customer/AuthTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,33 @@ public function testIsLoggedIn(): void
6666
$this->model->isLoggedIn()
6767
);
6868
}
69+
70+
/**
71+
* @dataProvider getCustomerShareScopeDataProvider
72+
*/
73+
public function testGetCustomerShareScope($configValue, int $expected): void
74+
{
75+
$this->scopeConfigMock->expects($this->once())
76+
->method('getValue')
77+
->with(
78+
'customer/account_share/scope',
79+
\Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE
80+
)
81+
->willReturn($configValue);
82+
83+
$this->assertSame($expected, $this->model->getCustomerShareScope());
84+
}
85+
86+
/**
87+
* @return array
88+
*/
89+
public function getCustomerShareScopeDataProvider(): array
90+
{
91+
return [
92+
'global scope as string 0' => ['0', 0],
93+
'website scope as string 1' => ['1', 1],
94+
'null value defaults to 0' => [null, 0],
95+
'empty string defaults to 0' => ['', 0],
96+
];
97+
}
6998
}

0 commit comments

Comments
 (0)