Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:magento/magento2ce into troll_p2
Browse files Browse the repository at this point in the history
  • Loading branch information
rganin committed Jul 12, 2016
2 parents 8fbb782 + d758023 commit 3cc4e0d
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Pricing/Price/TierPrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected function getBasePrice()
*/
public function getSavePercent(AmountInterface $amount)
{
return ceil(
return round(
100 - ((100 / $this->priceInfo->getPrice(FinalPrice::PRICE_CODE)->getValue())
* $amount->getBaseAmount())
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ public function dataProviderGetSavePercent()
return [
['basePrice' => '100', 'tierPrice' => '90', 'savedPercent' => '10'],
['basePrice' => '70', 'tierPrice' => '35', 'savedPercent' => '50'],
['basePrice' => '50', 'tierPrice' => '35', 'savedPercent' => '30']
['basePrice' => '50', 'tierPrice' => '35', 'savedPercent' => '30'],
['basePrice' => '20.80', 'tierPrice' => '18.72', 'savedPercent' => '10']
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function loadAttributeOptions()
'base_subtotal' => __('Subtotal'),
'total_qty' => __('Total Items Quantity'),
'weight' => __('Total Weight'),
'payment_method' => __('Payment Method'),
'shipping_method' => __('Shipping Method'),
'postcode' => __('Shipping Postcode'),
'region' => __('Shipping Region'),
Expand Down
23 changes: 7 additions & 16 deletions dev/tests/functional/tests/app/Magento/Backend/Test/Block/FormPageActions.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function back()
*/
public function reset()
{
$this->waitBeforeClick();
$this->waitForElementVisible($this->resetButton);
$this->_rootElement->find($this->resetButton)->click();
}

Expand All @@ -94,7 +94,7 @@ public function reset()
*/
public function saveAndContinue()
{
$this->waitBeforeClick();
$this->waitForElementVisible($this->saveAndContinueButton);
$this->_rootElement->find($this->saveAndContinueButton)->click();
$this->waitForElementNotVisible('.popup popup-loading');
$this->waitForElementNotVisible('.loader');
Expand All @@ -105,7 +105,7 @@ public function saveAndContinue()
*/
public function save()
{
$this->waitBeforeClick();
$this->waitForElementVisible($this->saveButton);
$this->_rootElement->find($this->saveButton)->click();
$this->waitForElementNotVisible($this->spinner);
$this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH);
Expand All @@ -117,7 +117,10 @@ public function save()
*/
public function delete()
{
$this->waitBeforeClick();
$this->waitForElementNotVisible($this->spinner);
$this->waitForElementNotVisible($this->loader, Locator::SELECTOR_XPATH);
$this->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_XPATH);
$this->waitForElementVisible($this->deleteButton);
$this->_rootElement->find($this->deleteButton)->click();
}

Expand All @@ -130,16 +133,4 @@ public function checkDeleteButton()
{
return $this->_rootElement->find($this->deleteButton)->isVisible();
}

/**
* Wait for User before clicking any Button which calls JS validation on correspondent form.
* See details in MAGETWO-31121.
*
* @return void
*/
protected function waitBeforeClick()
{
time_nanosleep(0, 600000000);
usleep(1000000);
}
}
1 change: 1 addition & 0 deletions dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ public function isFirstRowVisible()
*/
public function openFirstRow()
{
$this->waitLoader();
$this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->click();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function run()
{
$result['salesRule'] = null;
if ($this->salesRule !== null) {
$this->deleteAllSalesRule->run();
$salesRule = $this->fixtureFactory->createByCode(
'salesRule',
['dataset' => $this->salesRule]
Expand Down
12 changes: 0 additions & 12 deletions ...ests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public function processAssert(
$this->orderInvoiceNew = $orderInvoiceNew;
$this->orderCreditMemoNew = $orderCreditMemoNew;
$orderIndex->open();
$this->waitBeforeClick();
$orderIndex->getSalesOrderGrid()->openFirstRow();
//Check prices on order page
$actualPrices = [];
Expand Down Expand Up @@ -223,15 +222,4 @@ public function toString()
{
return 'Prices on backend after order creation is correct.';
}

/**
* Wait for User before click
*
* @return void
*/
protected function waitBeforeClick()
{
time_nanosleep(0, 600000000);
usleep(1000000);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function run()
{
$result['taxRule'] = null;
if ($this->taxRule !== null) {
$this->deleteAllTaxRule->run();
$taxRuleDataSets = explode(',', $this->taxRule);
foreach ($taxRuleDataSets as $taxRuleDataSet) {
$taxRule = $this->fixtureFactory->createByCode(
Expand Down
7 changes: 7 additions & 0 deletions lib/internal/Magento/Framework/HTTP/Client/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
*/
class Curl implements \Magento\Framework\HTTP\ClientInterface
{
/**
* Max supported protocol by curl CURL_SSLVERSION_TLSv1_2
* @var int
*/
private static $sslVersion = 6;

/**
* Hostname
* @var string
Expand Down Expand Up @@ -374,6 +380,7 @@ protected function makeRequest($method, $uri, $params = [])
//$this->curlOption(CURLOPT_HEADER, 1);
$this->curlOption(CURLOPT_RETURNTRANSFER, 1);
$this->curlOption(CURLOPT_HEADERFUNCTION, [$this, 'parseHeaders']);
$this->curlOption(CURLOPT_SSLVERSION, self::$sslVersion);

if (count($this->_curlUserOptions)) {
foreach ($this->_curlUserOptions as $k => $v) {
Expand Down

0 comments on commit 3cc4e0d

Please sign in to comment.