-
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.
[2.3-develop][Forwardport] #7822 Empty Checkout Agreement Edit Form w…
…hen Single Store Mode is enabled Forward port of #7822 Empty Checkout Agreement Edit Form when Single Store Mode is enabled to 2.3-develop
- Loading branch information
gwharton
committed
May 8, 2018
1 parent
b2eb795
commit d61fe1d
Showing
2 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
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
55 changes: 55 additions & 0 deletions
55
lib/internal/Magento/Framework/Test/Unit/Data/Form/Element/HiddenTest.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,55 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Framework\Test\Unit\Data\Form\Element; | ||
|
||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; | ||
|
||
/** | ||
* Test for \Magento\Framework\Data\Form\Element\Hidden. | ||
*/ | ||
class HiddenTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
/** | ||
* @var \Magento\Framework\Data\Form\Element\Hidden | ||
*/ | ||
private $element; | ||
|
||
protected function setUp() | ||
{ | ||
$objectManager = new ObjectManager($this); | ||
$this->element = $objectManager->getObject(\Magento\Framework\Data\Form\Element\Hidden::class); | ||
} | ||
|
||
/** | ||
* @param mixed $value | ||
* | ||
* @dataProvider getElementHtmlDataProvider | ||
*/ | ||
public function testGetElementHtml($value) | ||
{ | ||
$form = $this->createMock(\Magento\Framework\Data\Form::class); | ||
$this->element->setForm($form); | ||
$this->element->setValue($value); | ||
$html = $this->element->getElementHtml(); | ||
|
||
if (is_array($value)) { | ||
foreach ($value as $item) { | ||
$this->assertContains($item, $html); | ||
} | ||
} else { | ||
$this->assertContains($value, $html); | ||
} | ||
} | ||
|
||
public function getElementHtmlDataProvider() | ||
{ | ||
return [ | ||
['some_value'], | ||
['store_ids[]' => ['1', '2']], | ||
]; | ||
} | ||
} |