-
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.
Merge pull request #293 from magento-dragons/S67
[DRAGONS] - S67
- Loading branch information
Showing
51 changed files
with
1,186 additions
and
424 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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
/** | ||
* Option price interface | ||
* @api | ||
*/ | ||
interface BundleOptionPriceInterface | ||
{ | ||
|
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
/** | ||
* Interface DiscountProviderInterface | ||
* @api | ||
*/ | ||
interface DiscountProviderInterface | ||
{ | ||
|
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
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
76 changes: 76 additions & 0 deletions
76
...gento/Bundle/Test/Unit/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/ExtendTest.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,76 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Bundle\Test\Unit\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes; | ||
|
||
use Magento\Catalog\Model\Product; | ||
|
||
class ExtendTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject */ | ||
protected $registry; | ||
|
||
/** @var \Magento\Framework\Data\FormFactory|\PHPUnit_Framework_MockObject_MockObject */ | ||
protected $formFactory; | ||
|
||
/** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ | ||
protected $objectManagerHelper; | ||
|
||
/** @var \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Extend */ | ||
protected $object; | ||
|
||
public function setUp() | ||
{ | ||
$this->registry = $this->getMockBuilder('Magento\\Framework\\Registry')->disableOriginalConstructor()->getMock( | ||
); | ||
$this->formFactory = $this->getMockBuilder('Magento\\Framework\\Data\\FormFactory')->disableOriginalConstructor( | ||
)->getMock(); | ||
$this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); | ||
$this->object = $this->objectManagerHelper->getObject( | ||
'Magento\\Bundle\\Block\\Adminhtml\\Catalog\\Product\\Edit\\Tab\\Attributes\\Extend', | ||
['registry' => $this->registry, 'formFactory' => $this->formFactory] | ||
); | ||
} | ||
|
||
/** | ||
* @return \PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
public function getProduct() | ||
{ | ||
$product = $this->getMockBuilder(Product::class)->disableOriginalConstructor()->getMock(); | ||
$this->registry->expects($this->once()) | ||
->method('registry') | ||
->with('product') | ||
->will( | ||
$this->returnValue($product) | ||
); | ||
return $product; | ||
} | ||
|
||
public function testGetExtendedElement() | ||
{ | ||
$switchAttributeCode = 'test_code'; | ||
$form = $this->getMockBuilder(\Magento\Framework\Data\Form::class)->disableOriginalConstructor()->getMock(); | ||
$and = new \PHPUnit_Framework_Constraint_And(); | ||
$and->setConstraints( | ||
[ | ||
new \PHPUnit_Framework_Constraint_ArrayHasKey('value') | ||
] | ||
); | ||
$form->expects($this->once())->method('addField')->with( | ||
$switchAttributeCode, | ||
'select', | ||
$and | ||
); | ||
|
||
$this->formFactory->expects($this->once())->method('create')->with()->will($this->returnValue($form)); | ||
$product = $this->getProduct(); | ||
$product->expects($this->once())->method('getData')->with($switchAttributeCode)->will( | ||
$this->returnValue(123) | ||
); | ||
$this->object->setIsDisabledField(true); | ||
$this->object->getExtendedElement($switchAttributeCode); | ||
} | ||
} |
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
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
Oops, something went wrong.