File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
app/code/Magento/GoogleAnalytics/etc/adminhtml
dev/tests/integration/testsuite/Magento/GoogleAnalytics/Block Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 23
23
<field id =" */*/active" >1</field >
24
24
</depends >
25
25
</field >
26
-
27
- <field id =" anonymize" translate =" label" type =" select" sortOrder =" 30" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" >
26
+ <field id =" anonymize" translate =" label" type =" select" sortOrder =" 30" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" >
28
27
<label >Anonymize IP</label >
29
28
<source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
30
- <depends >
29
+ <depends >
31
30
<field id =" */*/active" >1</field >
32
31
</depends >
33
32
</field >
Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \GoogleAnalytics \Block ;
8
8
9
- use Magento \Framework \App \ObjectManager ;
10
9
use Magento \TestFramework \TestCase \AbstractController ;
11
10
12
11
class GaTest extends AbstractController
@@ -25,9 +24,7 @@ protected function setUp()
25
24
{
26
25
parent ::setUp ();
27
26
$ this ->dispatch ('/ ' );
28
- $ this ->layout = ObjectManager::getInstance ()->get (
29
- \Magento \Framework \View \LayoutInterface::class
30
- );
27
+ $ this ->layout = $ this ->_objectManager ->get (\Magento \Framework \View \LayoutInterface::class);
31
28
}
32
29
33
30
/**
@@ -90,6 +87,12 @@ public function testBlockOutputExistsWhenGaIsEnabled()
90
87
*/
91
88
private function getGaBlockFromNode ($ nodeName = 'head.additional ' )
92
89
{
93
- return $ this ->layout ->getChildBlock ($ nodeName , 'google_analytics ' );
90
+ $ childBlocks = $ this ->layout ->getChildBlocks ($ nodeName );
91
+ foreach ($ childBlocks as $ block ) {
92
+ if (strpos ($ block ->getNameInLayout (), 'google_analytics ' ) !== false ) {
93
+ return $ block ;
94
+ }
95
+ }
96
+ return false ;
94
97
}
95
98
}
You can’t perform that action at this time.
0 commit comments