-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #520 from magento-folks/bugs
[Folks] Bugs - MAGETWO-58334 [Github] Free shipping is not applied if cart price rule match #6584 - MAGETWO-57278 For Dutch locale, ZIP in checkout is already giving out a "validation failed" error at page load - MAGETWO-57675 [GITHUB] WYSIWYG editor does not show. #6222 #4828 #6815 - MAGETWO-56836 [FT] Update wishlist button doesn't receive the click in AddProductsToCartFromCustomerWishlistOnFrontendTest - MAGETWO-54412 [MERCHANT] Integrity Constraint Violation when creating orders #4580 - MAGETWO-58730 [Github] Incorrect province code sent on Checkout to UPS #6564
- Loading branch information
Showing
30 changed files
with
825 additions
and
15 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
84 changes: 84 additions & 0 deletions
84
app/code/Magento/Quote/Test/Unit/Model/ResourceModel/QuoteTest.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,84 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Quote\Test\Unit\Model\ResourceModel; | ||
|
||
class QuoteTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var \Magento\Quote\Model\ResourceModel\Quote | ||
*/ | ||
private $model; | ||
|
||
/** | ||
* @var \Magento\Framework\App\ResourceConnection | ||
*/ | ||
private $resourceMock; | ||
|
||
/** | ||
* @var \Magento\Framework\DB\Adapter\Pdo\Mysql | ||
*/ | ||
private $adapterMock; | ||
|
||
/** | ||
* @var \Magento\Framework\DB\Select | ||
*/ | ||
private $selectMock; | ||
|
||
protected function setUp() | ||
{ | ||
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); | ||
$this->selectMock = $this->getMockBuilder(\Magento\Framework\DB\Select::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$this->selectMock->expects($this->any())->method('from')->will($this->returnSelf()); | ||
$this->selectMock->expects($this->any())->method('where'); | ||
|
||
$this->adapterMock = $this->getMockBuilder(\Magento\Framework\DB\Adapter\Pdo\Mysql::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$this->adapterMock->expects($this->any())->method('select')->will($this->returnValue($this->selectMock)); | ||
|
||
$this->resourceMock = $this->getMockBuilder(\Magento\Framework\App\ResourceConnection::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$this->resourceMock->expects( | ||
$this->any() | ||
)->method( | ||
'getConnection' | ||
)->will( | ||
$this->returnValue($this->adapterMock) | ||
); | ||
|
||
$this->model = $objectManagerHelper->getObject( | ||
\Magento\Quote\Model\ResourceModel\Quote::class, | ||
[ | ||
'resource' => $this->resourceMock | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Unit test to verify if isOrderIncrementIdUsed method works with different types increment ids | ||
* | ||
* @param array $value | ||
* @dataProvider isOrderIncrementIdUsedDataProvider | ||
*/ | ||
public function testIsOrderIncrementIdUsed($value) | ||
{ | ||
$expectedBind = [':increment_id' => $value]; | ||
$this->adapterMock->expects($this->once())->method('fetchOne')->with($this->selectMock, $expectedBind); | ||
$this->model->isOrderIncrementIdUsed($value); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function isOrderIncrementIdUsedDataProvider() | ||
{ | ||
return [[100000001], ['10000000001'], ['M10000000001']]; | ||
} | ||
} |
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.