File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
app/code/Magento/Customer/Test/Unit/ViewModel/Customer Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments