Skip to content

Commit

Permalink
Merge pull request #530 from magento-folks/bugs
Browse files Browse the repository at this point in the history
[Folks] Bugfix
  • Loading branch information
Momotenko,Natalia(nmomotenko) committed Apr 15, 2016
2 parents ea52f98 + a7b60da commit 2a71879
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/code/Magento/Checkout/Model/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/**
* Shopping cart model
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @deprecated
*/
class Cart extends DataObject implements CartInterface
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/Checkout/Model/Cart/CartInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Shopping cart interface
*
* @author Magento Core Team <core@magentocommerce.com>
* @deprecated
*/
interface CartInterface
{
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Checkout/Model/Sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use Magento\Quote\Api\Data\CartItemInterface;
use Magento\Quote\Model\Quote\Address\Total;

/**
* @deprecated
*/
class Sidebar
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@ public function getAssociatedProducts($product)
return $product->getData($this->_keyAssociatedProducts);
}

/**
* @param \Magento\Catalog\Model\Product $product
* @return \Magento\Catalog\Model\Product
*/
public function flushAssociatedProductsCache($product)
{
return $product->unsData($this->_keyAssociatedProducts);
}

/**
* Add status filter to collection
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ public function testPrepareForCartAdvancedEmpty()
$this->_model->prepareForCartAdvanced($buyRequest, $this->product)
);


$buyRequest->setSuperGroup(1);
$this->assertEquals(
$expectedMsg,
Expand Down Expand Up @@ -603,4 +602,14 @@ public function testPrepareForCartAdvancedZeroQty()
->will($this->returnValue([$associatedProduct]));
$this->assertEquals($expectedMsg, $this->_model->prepareForCartAdvanced($buyRequest, $this->product));
}

public function testFlushAssociatedProductsCache()
{
$productMock = $this->getMock('\Magento\Catalog\Model\Product', ['unsData'], [], '', false);
$productMock->expects($this->once())
->method('unsData')
->with('_cache_instance_associated_products')
->willReturnSelf();
$this->assertEquals($productMock, $this->_model->flushAssociatedProductsCache($productMock));
}
}
2 changes: 1 addition & 1 deletion dev/tests/functional/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"magento/mtf": "1.0.0-rc41",
"magento/mtf": "1.0.0-rc42",
"php": "~5.5.22|~5.6.0|~7.0.0",
"phpunit/phpunit": "4.1.0",
"phpunit/phpunit-selenium": ">=1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class WebapiResponse extends AbstractObserver
public function process(Event $event)
{
$directory = $this->createDestinationDirectory('webapi-response');
$this->logger->log(json_encode($event->getSubjects()[0]), $directory . '/' . $event->getIdentifier() . '.json');
$this->logger->log(
json_encode($event->getSubjects()[0]),
$directory . '/' . $event->getFileIdentifier() . '.json'
);
}
}

0 comments on commit 2a71879

Please sign in to comment.