Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
tests
app
Magento
Downloadable
Test
Constraint
AssertDownloadableDuplicateForm.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Downloadable\Test\Constraint
;
8
9
use
Magento\Catalog\Test\Constraint\AssertProductDuplicateForm
;
10
14
class
AssertDownloadableDuplicateForm
extends
AssertProductDuplicateForm
15
{
19
protected
function
prepareFixtureData
(array
$data
, array
$sortFields
= [])
20
{
21
return
$this->
prepareDownloadableArray
(parent::prepareFixtureData(
$data
));
22
}
23
30
protected
function
sortDownloadableArray
(array
$fields
)
31
{
32
usort(
33
$fields
,
34
function
($row1, $row2) {
35
if
($row1[
'sort_order'
] == $row2[
'sort_order'
]) {
36
return
0;
37
}
38
39
return
($row1[
'sort_order'
] < $row2[
'sort_order'
]) ? -1 : 1;
40
}
41
);
42
43
return
$fields
;
44
}
45
52
protected
function
prepareDownloadableArray
(array
$fields
)
53
{
54
if
(isset(
$fields
[
'downloadable_links'
][
'downloadable'
][
'link'
])) {
55
$fields
[
'downloadable_links'
][
'downloadable'
][
'link'
] = $this->
sortDownloadableArray
(
56
$fields[
'downloadable_links'
][
'downloadable'
][
'link'
]
57
);
58
}
59
if
(isset(
$fields
[
'downloadable_sample'
][
'downloadable'
][
'sample'
])) {
60
$fields
[
'downloadable_sample'
][
'downloadable'
][
'sample'
] = $this->
sortDownloadableArray
(
61
$fields[
'downloadable_sample'
][
'downloadable'
][
'sample'
]
62
);
63
}
64
65
return
$fields
;
66
}
67
}
$fields
$fields
Definition:
details.phtml:14
Magento\Catalog\Test\Constraint\AssertProductDuplicateForm
Definition:
AssertProductDuplicateForm.php:16
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Downloadable\Test\Constraint\AssertDownloadableDuplicateForm
Definition:
AssertDownloadableDuplicateForm.php:14
Magento\Downloadable\Test\Constraint\AssertDownloadableDuplicateForm\prepareDownloadableArray
prepareDownloadableArray(array $fields)
Definition:
AssertDownloadableDuplicateForm.php:52
Magento\Catalog\Test\Constraint\AssertProductForm\$sortFields
$sortFields
Definition:
AssertProductForm.php:34
Magento\Downloadable\Test\Constraint
Definition:
AbstractAssertTaxCalculationAfterCheckoutDownloadable.php:7
Magento\Downloadable\Test\Constraint\AssertDownloadableDuplicateForm\sortDownloadableArray
sortDownloadableArray(array $fields)
Definition:
AssertDownloadableDuplicateForm.php:30
Magento\Downloadable\Test\Constraint\AssertDownloadableDuplicateForm\prepareFixtureData
prepareFixtureData(array $data, array $sortFields=[])
Definition:
AssertDownloadableDuplicateForm.php:19