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
Exceptions
Collector
ExceptionCollector.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\FunctionalTestingFramework\Exceptions\Collector
;
7
8
class
ExceptionCollector
9
{
15
private
$errors = [];
16
24
public
function
addError
($filename,
$message
)
25
{
26
$error[$filename] =
$message
;
27
$this->errors = array_merge_recursive($this->errors, $error);
28
}
29
36
public
function
throwException
()
37
{
38
if
(empty($this->errors)) {
39
return
;
40
}
41
42
$errorMsg = implode(
"\n\n"
, $this->formatErrors($this->errors));
43
throw
new \Exception(
"\n"
. $errorMsg);
44
}
45
53
private
function
formatErrors($errors)
54
{
55
$flattenedErrors = [];
56
foreach
($errors as $key => $errorMsg) {
57
if
(is_array($errorMsg)) {
58
$flattenedErrors = array_merge($flattenedErrors, $this->formatErrors($errorMsg));
59
continue
;
60
}
61
62
$flattenedErrors[] = $errorMsg;
63
}
64
65
return
$flattenedErrors;
66
}
67
}
Magento\FunctionalTestingFramework\Exceptions\Collector\ExceptionCollector\throwException
throwException()
Definition:
ExceptionCollector.php:36
Magento\FunctionalTestingFramework\Exceptions\Collector
Definition:
ExceptionCollector.php:6
$message
$message
Definition:
notifications.php:7
Magento\FunctionalTestingFramework\Exceptions\Collector\ExceptionCollector
Definition:
ExceptionCollector.php:8
Magento\FunctionalTestingFramework\Exceptions\Collector\ExceptionCollector\addError
addError($filename, $message)
Definition:
ExceptionCollector.php:24