-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge magento/2.3-develop into magento-chaika/Chaika-PR-2019-09-26
- Loading branch information
Showing
11 changed files
with
288 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Config\Model\Config\Backend\File; | ||
|
||
/** | ||
* System config PDF field backend model. | ||
*/ | ||
class Pdf extends \Magento\Config\Model\Config\Backend\File | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function _getAllowedExtensions() | ||
{ | ||
return ['pdf']; | ||
} | ||
} |
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
101 changes: 101 additions & 0 deletions
101
...Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml
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,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="SelectAllDownloadableLinksDownloadableProductTest"> | ||
<annotations> | ||
<features value="Catalog"/> | ||
<stories value="Create Downloadable Product"/> | ||
<title value="Select all downloadable links downloadable product test"/> | ||
<description value="All the downloadable links must be selected or unselected when anyone click on select all or unselect all checkbox respectively."/> | ||
<severity value="MAJOR"/> | ||
<group value="Downloadable"/> | ||
</annotations> | ||
<before> | ||
<!-- Create category --> | ||
<createData entity="SimpleSubCategory" stepKey="createCategory"/> | ||
|
||
<!-- Login as admin --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> | ||
|
||
<!-- Create downloadable product --> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> | ||
<waitForPageLoad stepKey="waitForProductGridPageLoad"/> | ||
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> | ||
<argument name="productType" value="downloadable"/> | ||
</actionGroup> | ||
|
||
<!-- Fill downloadable product values --> | ||
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> | ||
<argument name="product" value="DownloadableProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Add downloadable product to category --> | ||
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" | ||
parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> | ||
|
||
<!-- Fill downloadable link information before the creation link --> | ||
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> | ||
|
||
<!-- Links can be purchased separately --> | ||
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" | ||
stepKey="checkOptionPurchaseSeparately"/> | ||
|
||
<!-- Add first downloadable link --> | ||
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> | ||
<argument name="link" value="downloadableLinkWithMaxDownloads"/> | ||
</actionGroup> | ||
|
||
<!-- Add second downloadable link --> | ||
<actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> | ||
<argument name="link" value="downloadableLink"/> | ||
</actionGroup> | ||
|
||
<!-- Save product --> | ||
<actionGroup ref="saveProductForm" stepKey="saveProduct"/> | ||
</before> | ||
<after> | ||
<!-- Delete category --> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
|
||
<!-- Delete created downloadable product --> | ||
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> | ||
<argument name="product" value="DownloadableProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Log out --> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Step 1: Navigate to store front Product page as guest --> | ||
<amOnPage url="/{{DownloadableProduct.sku}}.html" | ||
stepKey="amOnStorefrontProductPage"/> | ||
|
||
<!-- Step 2: click on select all checkbox --> | ||
<click | ||
selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllCheckbox}}" | ||
stepKey="selectAllProductLink"/> | ||
|
||
<!-- Step 3: Make sure that all product links are checked --> | ||
<seeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}" stepKey="seeFirstCheckboxChecked"/> | ||
|
||
<seeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="seeSecondCheckboxChecked"/> | ||
|
||
<!-- Step 4: click again on select all checkbox --> | ||
<click | ||
selector="{{StorefrontDownloadableProductSection.downloadableLinkSelectAllCheckbox}}" | ||
stepKey="unselectAllProductLink"/> | ||
|
||
<!-- Step 5: Make sure that all product links are unchecked --> | ||
<dontSeeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLinkWithMaxDownloads.title)}}" stepKey="seeFirstCheckboxUnChecked"/> | ||
|
||
<dontSeeCheckboxIsChecked selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="seeSecondCheckboxUnChecked"/> | ||
|
||
</test> | ||
</tests> |
30 changes: 30 additions & 0 deletions
30
app/code/Magento/SalesRule/Model/Rule/Action/SimpleActionOptionsProvider.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,30 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\SalesRule\Model\Rule\Action; | ||
|
||
use Magento\Framework\Data\OptionSourceInterface; | ||
use Magento\SalesRule\Model\Rule; | ||
|
||
/** | ||
* Class SimpleActionOptionsProvider | ||
*/ | ||
class SimpleActionOptionsProvider implements OptionSourceInterface | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
return [ | ||
['label' => __('Percent of product price discount'), 'value' => Rule::BY_PERCENT_ACTION], | ||
['label' => __('Fixed amount discount'), 'value' => Rule::BY_FIXED_ACTION], | ||
['label' => __('Fixed amount discount for whole cart'), 'value' => Rule::CART_FIXED_ACTION], | ||
['label' => __('Buy X get Y free (discount amount is Y)'), 'value' => Rule::BUY_X_GET_Y_ACTION] | ||
]; | ||
} | ||
} |
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
43 changes: 43 additions & 0 deletions
43
app/code/Magento/SalesRule/Test/Unit/Model/Rule/Action/SimpleActionOptionsProviderTest.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,43 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\SalesRule\Test\Unit\Model\Rule\Action; | ||
|
||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; | ||
use Magento\SalesRule\Model\Rule; | ||
use Magento\SalesRule\Model\Rule\Action\SimpleActionOptionsProvider; | ||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @covers Magento\SalesRule\Model\Rule\Action\SimpleActionOptionsProvider | ||
*/ | ||
class SimpleActionOptionsProviderTest extends TestCase | ||
{ | ||
/** | ||
* @var SimpleActionOptionsProvider|MockObject | ||
*/ | ||
protected $model; | ||
|
||
protected function setUp() | ||
{ | ||
$objectManager = new ObjectManager($this); | ||
|
||
$this->model = $objectManager->getObject(SimpleActionOptionsProvider::class); | ||
} | ||
|
||
public function testToOptionArray() | ||
{ | ||
$expected = [ | ||
['label' => __('Percent of product price discount'), 'value' => Rule::BY_PERCENT_ACTION], | ||
['label' => __('Fixed amount discount'), 'value' => Rule::BY_FIXED_ACTION], | ||
['label' => __('Fixed amount discount for whole cart'), 'value' => Rule::CART_FIXED_ACTION], | ||
['label' => __('Buy X get Y free (discount amount is Y)'), 'value' => Rule::BUY_X_GET_Y_ACTION] | ||
]; | ||
|
||
$this->assertEquals($expected, $this->model->toOptionArray()); | ||
} | ||
} |
Oops, something went wrong.