-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#12285: The option <var name="allowfullscreen">false</var> for mobile…
… device don't work in product view page gallery
- Loading branch information
1 parent
321278b
commit ccc35c2
Showing
2 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
dev/tests/integration/testsuite/Magento/Framework/Config/ConverterTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Framework\Config; | ||
|
||
use Magento\Framework\ObjectManagerInterface; | ||
|
||
/** | ||
* Tests Magento\Framework\Config\Convert | ||
*/ | ||
class ConverterTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
/** | ||
* @var ObjectManagerInterface | ||
*/ | ||
private $objectManager; | ||
|
||
/** | ||
* @var Converter | ||
*/ | ||
private $converter; | ||
|
||
/** | ||
* Tests config value "false" is not interpreted as true. | ||
* | ||
* @param string $sourceString | ||
* @param array $expected | ||
* @dataProvider parseVarElementDataProvider | ||
*/ | ||
public function testParseVarElement($sourceString, $expected) | ||
{ | ||
$document = new \DOMDocument(); | ||
$document->loadXML($sourceString); | ||
$actual = $this->converter->convert($document); | ||
|
||
self::assertEquals( | ||
$expected, | ||
$actual | ||
); | ||
} | ||
|
||
/** | ||
* Data provider for testParseVarElement. | ||
* | ||
* @return array | ||
*/ | ||
public function parseVarElementDataProvider() | ||
{ | ||
$sourceString = <<<'XML' | ||
<?xml version="1.0"?> | ||
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> | ||
<vars module="Magento_Test"> | ||
<var name="str">some string</var> | ||
<var name="int-1">1</var> | ||
<var name="int-0">0</var> | ||
<var name="bool-true">true</var> | ||
<var name="bool-false">false</var> | ||
</vars> | ||
</view> | ||
XML; | ||
$expectedResult = [ | ||
'vars' => [ | ||
'Magento_Test' => [ | ||
'str' => 'some string', | ||
'int-1' => '1', | ||
'int-0' => '0', | ||
'bool-true' => true, | ||
'bool-false' => false | ||
] | ||
] | ||
]; | ||
|
||
return [ | ||
[ | ||
$sourceString, | ||
$expectedResult | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function setUp() | ||
{ | ||
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); | ||
$this->converter = $this->objectManager->get(Converter::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters