File tree Expand file tree Collapse file tree 4 files changed +37
-14
lines changed
design/frontend/Magento/luma/Magento_Theme/layout Expand file tree Collapse file tree 4 files changed +37
-14
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public function getLogoWidth()
98
98
\Magento \Store \Model \ScopeInterface::SCOPE_STORE
99
99
);
100
100
}
101
- return (int )$ this ->_data ['logo_width ' ] ? : ( int ) $ this -> getLogoImgWidth () ;
101
+ return (int )$ this ->_data ['logo_width ' ];
102
102
}
103
103
104
104
/**
@@ -114,7 +114,7 @@ public function getLogoHeight()
114
114
\Magento \Store \Model \ScopeInterface::SCOPE_STORE
115
115
);
116
116
}
117
- return (int )$ this ->_data ['logo_height ' ] ? : ( int ) $ this -> getLogoImgHeight () ;
117
+ return (int )$ this ->_data ['logo_height ' ];
118
118
}
119
119
120
120
/**
Original file line number Diff line number Diff line change @@ -44,4 +44,38 @@ public function testGetLogoSrc()
44
44
45
45
$ this ->assertEquals ('http://localhost/pub/media/logo/default/image.gif ' , $ block ->getLogoSrc ());
46
46
}
47
+
48
+ /**
49
+ * cover \Magento\Theme\Block\Html\Header\Logo::getLogoHeight
50
+ */
51
+ public function testGetLogoHeight ()
52
+ {
53
+ $ scopeConfig = $ this ->createMock (\Magento \Framework \App \Config \ScopeConfigInterface::class);
54
+ $ scopeConfig ->expects ($ this ->once ())->method ('getValue ' )->willReturn (null );
55
+
56
+ $ objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
57
+ $ arguments = [
58
+ 'scopeConfig ' => $ scopeConfig ,
59
+ ];
60
+ $ block = $ objectManager ->getObject (\Magento \Theme \Block \Html \Header \Logo::class, $ arguments );
61
+
62
+ $ this ->assertEquals (null , $ block ->getLogoHeight ());
63
+ }
64
+
65
+ /**
66
+ * @covers \Magento\Theme\Block\Html\Header\Logo::getLogoWidth
67
+ */
68
+ public function testGetLogoWidth ()
69
+ {
70
+ $ scopeConfig = $ this ->createMock (\Magento \Framework \App \Config \ScopeConfigInterface::class);
71
+ $ scopeConfig ->expects ($ this ->once ())->method ('getValue ' )->willReturn ('170 ' );
72
+
73
+ $ objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
74
+ $ arguments = [
75
+ 'scopeConfig ' => $ scopeConfig ,
76
+ ];
77
+ $ block = $ objectManager ->getObject (\Magento \Theme \Block \Html \Header \Logo::class, $ arguments );
78
+
79
+ $ this ->assertEquals ('170 ' , $ block ->getLogoHeight ());
80
+ }
47
81
}
Original file line number Diff line number Diff line change 50
50
</container >
51
51
</container >
52
52
<container name =" header-wrapper" label =" Page Header" as =" header-wrapper" htmlTag =" div" htmlClass =" header content" >
53
- <block class =" Magento\Theme\Block\Html\Header\Logo" name =" logo" >
54
- <arguments >
55
- <argument name =" logo_img_width" xsi : type =" number" >189</argument >
56
- <argument name =" logo_img_height" xsi : type =" number" >64</argument >
57
- </arguments >
58
- </block >
53
+ <block class =" Magento\Theme\Block\Html\Header\Logo" name =" logo" />
59
54
</container >
60
55
</referenceContainer >
61
56
<referenceContainer name =" page.top" >
Original file line number Diff line number Diff line change 14
14
</arguments >
15
15
</block >
16
16
</referenceContainer >
17
- <referenceBlock name =" logo" >
18
- <arguments >
19
- <argument name =" logo_img_width" xsi : type =" number" >148</argument >
20
- <argument name =" logo_img_height" xsi : type =" number" >43</argument >
21
- </arguments >
22
- </referenceBlock >
23
17
<referenceContainer name =" footer" >
24
18
<block class =" Magento\Store\Block\Switcher" name =" store_switcher" as =" store_switcher" after =" footer_links" template =" Magento_Store::switch/stores.phtml" />
25
19
</referenceContainer >
You can’t perform that action at this time.
0 commit comments