Skip to content

Commit

Permalink
Merge pull request #103 from magento-firedrakes/MAGETWO-53424
Browse files Browse the repository at this point in the history
[Firedrakes] P1 bugfixes
  • Loading branch information
Alexander Akimov authored Jun 14, 2016
2 parents 4b6e1da + 682e62b commit 68a91a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,10 @@ public function testReindexFull()

$this->indexerBuilder->reindexFull();

$this->assertEquals(9.8, $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->product->getId()));
$this->assertEquals(
9.8,
$this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productSecond->getId())
);
$rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->product->getId());
$this->assertEquals(9.8, $rulePrice);
$rulePrice = $this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productSecond->getId());
$this->assertEquals(9.8, $rulePrice);
$this->assertFalse($this->resourceRule->getRulePrice(new \DateTime(), 1, 1, $this->productThird->getId()));
}

Expand All @@ -113,7 +112,7 @@ protected function prepareProducts()
$product->load($product->getId());
$this->product = $product;

$this->product->setData('test_attribute', 'test_attribute_value')->save();
$this->product->setStoreId(0)->setData('test_attribute', 'test_attribute_value')->save();
$this->productSecond = clone $this->product;
$this->productSecond->setId(null)->setUrlKey('product-second')->save();
$this->productThird = clone $this->product;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function execute($entity, $arguments = [])
$entityData = array_merge($hydrator->extract($entity), $arguments);
$actions = $this->attributePool->getActions($entityType, 'create');
foreach ($actions as $action) {
$action->execute($entityType, $entityData);
$action->execute($entityType, $entityData, $arguments);
}
$entity = $hydrator->hydrate($entity, $entityData);
return $entity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function execute($entity, $identifier, $arguments = [])
'arguments' => $arguments
]
);
$entity = $this->readMain->execute($entity, $identifier, $arguments);
$entity = $this->readMain->execute($entity, $identifier);
$entityData = array_merge($hydrator->extract($entity), $arguments);
if (isset($entityData[$metadata->getLinkField()])) {
$entity = $this->readAttributes->execute($entity, $arguments);
Expand Down

0 comments on commit 68a91a9

Please sign in to comment.