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-functional-testing-framework
src
Magento
FunctionalTestingFramework
Module
MagentoAssert.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\FunctionalTestingFramework\Module
;
8
16
class
MagentoAssert
extends
\Codeception\Module
17
{
26
public
function
assertArrayIsSorted
(array
$data
, $sortOrder =
"asc"
)
27
{
28
$elementTotal = count(
$data
);
29
$message
=
null
;
30
31
// If value can be converted to a date and it isn't 1.1 number (strtotime is overzealous)
32
if
(strtotime(
$data
[0]) !==
false
&& !is_numeric(
$data
[0])) {
33
$message
=
"Array of dates converted to unix timestamp for comparison"
;
34
$data
= array_map(
'strtotime'
,
$data
);
35
}
else
{
36
$data
= array_map(
'strtolower'
,
$data
);
37
}
38
39
if
($sortOrder ==
"asc"
) {
40
for
(
$i
= 1;
$i
< $elementTotal;
$i
++) {
41
// $i >= $i-1
42
$this->assertLessThanOrEqual(
$data
[
$i
],
$data
[
$i
-1],
$message
);
43
}
44
}
else
{
45
for
(
$i
= 1;
$i
< $elementTotal;
$i
++) {
46
// $i <= $i-1
47
$this->assertGreaterThanOrEqual(
$data
[
$i
],
$data
[
$i
-1],
$message
);
48
}
49
}
50
}
51
}
Magento\FunctionalTestingFramework\Module\MagentoAssert
Definition:
MagentoAssert.php:16
Magento\FunctionalTestingFramework\Module\MagentoAssert\assertArrayIsSorted
assertArrayIsSorted(array $data, $sortOrder="asc")
Definition:
MagentoAssert.php:26
$message
$message
Definition:
notifications.php:7
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
$i
$i
Definition:
gallery.phtml:31
Magento\FunctionalTestingFramework\Module
Definition:
MagentoAssert.php:7