Skip to content

Commit c673db6

Browse files
author
Onischenko, Yaroslav(yonischenko)
committed
Merge pull request #431 from magento-nord/MAGETWO-39764
[NORD] Sprint 24
2 parents 5360185 + a205aa4 commit c673db6

File tree

7 files changed

+84
-7
lines changed

7 files changed

+84
-7
lines changed

app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,21 @@
4545
<?php endif; ?>
4646
<button type="submit"
4747
name="update_cart_action"
48+
data-cart-empty=""
4849
value="empty_cart"
4950
title="<?php echo $block->escapeHtml(__('Clear Shopping Cart')); ?>"
5051
class="action clear" id="empty_cart_button">
5152
<span><?php echo __('Clear Shopping Cart'); ?></span>
5253
</button>
5354
<button type="submit"
5455
name="update_cart_action"
56+
data-cart-item-update=""
5557
value="update_qty"
5658
title="<?php echo $block->escapeHtml(__('Update Shopping Cart')); ?>"
5759
class="action update">
5860
<span><?php echo __('Update Shopping Cart'); ?></span>
5961
</button>
60-
<input type="hidden" value="" id="update_cart_action_container" />
62+
<input type="hidden" value="" id="update_cart_action_container" data-cart-item-update=""/>
6163
</div>
6264
</form>
6365
<?php echo $block->getChildHtml('checkout.cart.order.actions') ?>

app/code/Magento/Checkout/view/frontend/templates/cart/item/default.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
9393
<div class="control qty">
9494
<input id="cart-<?php echo $_item->getId() ?>-qty"
9595
name="cart[<?php echo $_item->getId() ?>][qty]"
96+
data-cart-item-id="<?php echo $_item->getSku() ?>"
9697
value="<?php echo $block->getQty() ?>"
9798
type="number"
9899
size="4"

app/code/Magento/Downloadable/view/frontend/templates/checkout/cart/item/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
8787
<?php endif; ?>
8888
<td class="col qty" data-th="<?php echo $block->escapeHtml(__('Qty')); ?>">
8989
<div class="control qty">
90-
<input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $block->getQty() ?>" type="number" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" maxlength="12" data-validate="{'required-number':true,'validate-greater-than-zero':true}" data-role="cart-item-qty"/>
90+
<input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $block->getQty() ?>" type="number" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" data-cart-item-id="<?php echo $block->escapeHtml(__($_item->getSku())) ?>" maxlength="12" data-validate="{'required-number':true,'validate-greater-than-zero':true}" data-role="cart-item-qty"/>
9191
</div>
9292
<?php $cols++; ?>
9393
</td>

app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<span><?php echo __('Qty') ?></span>
4343
</label>
4444
<div class="control">
45-
<input type="number" id="ship-<?php echo $_index ?>-<?php echo $_item->getQuoteItemId() ?>-qty" name="ship[<?php echo $_index ?>][<?php echo $_item->getQuoteItemId() ?>][qty]" value="<?php echo $block->escapeHtml($_item->getQty()) ?>" size="2" class="input-text qty" data-validate="{number: true}"/>
45+
<input type="number" data-multiship-item-id="<?php echo $_item->getSku() ?>" id="ship-<?php echo $_index ?>-<?php echo $_item->getQuoteItemId() ?>-qty" name="ship[<?php echo $_index ?>][<?php echo $_item->getQuoteItemId() ?>][qty]" value="<?php echo $block->escapeHtml($_item->getQty()) ?>" size="2" class="input-text qty" data-validate="{number: true}"/>
4646
</div>
4747
</div>
4848
</td>
@@ -61,7 +61,7 @@
6161
<?php endif; ?>
6262
</td>
6363
<td class="col actions" data-th="<?php echo $block->escapeHtml(__('Actions'));?>">
64-
<a href="<?php echo $block->getItemDeleteUrl($_item) ?>" title="<?php echo __('Remove Item') ?>" class="action delete">
64+
<a href="<?php echo $block->getItemDeleteUrl($_item) ?>" title="<?php echo __('Remove Item') ?>" class="action delete" data-multiship-item-update="">
6565
<span><?php echo __('Remove item') ?></span>
6666
</a>
6767
</td>
@@ -76,7 +76,7 @@
7676
<button type="submit" title="<?php echo __('Go to Shipping Information') ?>" class="action primary continue<?php if ($block->isContinueDisabled()):?> disabled<?php endif; ?>" data-role="can-continue" data-flag="1"<?php if ($block->isContinueDisabled()):?> disabled="disabled"<?php endif; ?>><span><?php echo __('Go to Shipping Information') ?></span></button>
7777
</div>
7878
<div class="secondary">
79-
<button type="submit" class="action update" data-role="can-continue" data-flag="0"><span><?php echo __('Update Qty &amp; Addresses') ?></span></button>
79+
<button type="submit" data-multiship-item-update="" class="action update" data-role="can-continue" data-flag="0"><span><?php echo __('Update Qty &amp; Addresses') ?></span></button>
8080
<button type="button" title="<?php echo __('Enter a New Address') ?>" class="action add" data-role="add-new-address"><span><?php echo __('Enter a New Address') ?></span></button>
8181
<a href="<?php echo $block->getBackUrl() ?>" class="action back"><span><?php echo __('Back to Shopping Cart') ?></span></a>
8282
</div>

app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function showCustomerInfo()
146146
[
147147
'customer' => $this->getTable('customer_entity')
148148
],
149-
'main_table.customer_id',
149+
'main_table.customer_id = customer.entity_id',
150150
[
151151
'customer_lastname' => 'lastname',
152152
'customer_firstname' => 'firstname'

setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,16 @@ public function testStartAction()
6262
$this->assertTrue($variables['success']);
6363
}
6464

65-
public function testStartActionWithError()
65+
public function testStartActionException()
66+
{
67+
$this->webLogger->expects($this->once())->method('clear');
68+
$this->installer->expects($this->once())->method('install')
69+
->willThrowException($this->getMock('\Magento\Setup\SampleDataException'));
70+
$jsonModel = $this->controller->startAction();
71+
$this->assertTrue($jsonModel->getVariable('isSampleDataError'));
72+
}
73+
74+
public function testStartActionWithSampleDataError()
6675
{
6776
$this->webLogger->expects($this->once())->method('clear');
6877
$this->webLogger->expects($this->once())->method('logError');
@@ -108,6 +117,19 @@ public function testProgressActionWithError()
108117
$this->assertStringStartsWith('exception \'LogicException\' with message \'' . $e, $variables['console'][0]);
109118
}
110119

120+
public function testProgressActionWithSampleDataError()
121+
{
122+
$this->progressFactory->expects($this->once())->method('createFromLog')
123+
->willThrowException($this->getMock('\Magento\Setup\SampleDataException'));
124+
$jsonModel = $this->controller->progressAction();
125+
$this->assertInstanceOf('\Zend\View\Model\JsonModel', $jsonModel);
126+
$variables = $jsonModel->getVariables();
127+
$this->assertArrayHasKey('success', $variables);
128+
$this->assertArrayHasKey('console', $variables);
129+
$this->assertFalse($variables['success']);
130+
$this->assertTrue($jsonModel->getVariable('isSampleDataError'));
131+
}
132+
111133
public function testDispatch()
112134
{
113135
$request = $this->getMock('\Zend\Http\PhpEnvironment\Request', [], [], '', false);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Setup\Test\Unit\Model;
8+
9+
use Magento\Setup\Model\SampleData;
10+
11+
/**
12+
* Test Magento\Setup\Model\SampleData
13+
*/
14+
class SampleDataTest extends \PHPUnit_Framework_TestCase
15+
{
16+
/**
17+
* @var \Magento\Setup\Model\SampleData
18+
*/
19+
protected $sampleDataInstall;
20+
21+
/**
22+
* @var \Magento\Framework\Setup\LoggerInterface
23+
*/
24+
protected $loggerInterface;
25+
26+
/**
27+
* @var \Magento\Framework\App\Filesystem\DirectoryList
28+
*/
29+
protected $directoryList;
30+
31+
protected function setUp()
32+
{
33+
$this->loggerInterface = $this->getMock('Magento\Framework\Setup\LoggerInterface');
34+
$this->directoryList = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false);
35+
$this->sampleDataInstall = new SampleData($this->directoryList);
36+
}
37+
38+
public function testIsDeployed()
39+
{
40+
$this->directoryList->expects($this->once())->method('getPath')->with('code');
41+
$this->sampleDataInstall->isDeployed();
42+
}
43+
44+
/**
45+
* Test SampleData installation check method.
46+
* Can be tested only negative case because file_exists method used in the tested class
47+
*/
48+
public function testIsInstalledSuccessfully()
49+
{
50+
$this->assertFalse($this->sampleDataInstall->isInstalledSuccessfully());
51+
}
52+
}

0 commit comments

Comments
 (0)