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
framework
View
Test
Unit
Helper
PathPatternTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Test\Unit\Helper
;
7
8
use
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
as ObjectManagerHelper;
9
10
class
PathPatternTest
extends
\PHPUnit\Framework\TestCase
11
{
15
protected
$pathPatternHelper
;
16
20
protected
$objectManagerHelper
;
21
22
protected
function
setUp
()
23
{
24
$this->objectManagerHelper =
new
ObjectManagerHelper($this);
25
$this->pathPatternHelper = $this->objectManagerHelper->getObject(
26
\
Magento
\Framework\View\Helper\PathPattern::class
27
);
28
}
29
36
public
function
testTranslatePatternFromGlob
(
$path
, $expectedPattern)
37
{
38
$this->assertEquals($expectedPattern, $this->pathPatternHelper->translatePatternFromGlob(
$path
));
39
}
40
44
public
function
translatePatternFromGlobDataProvider
()
45
{
46
return
[
47
[
48
'path'
=>
'*.xml'
,
49
'expectedPattern'
=>
'[^/]*\\.xml'
50
],
51
[
52
'path'
=>
'd??.*'
,
53
'expectedPattern'
=>
'd[^/][^/]\\.[^/]*'
54
],
55
[
56
'path'
=>
'[!0-9]?-[a-fA-F0-9].php'
,
57
'expectedPattern'
=>
'[^0-9][^/]\\-[a-fA-F0-9]\\.php'
58
],
59
[
60
'path'
=>
'config.{php,json,xml}'
,
61
'expectedPattern'
=>
'config\\.(?:php|json|xml)'
62
],
63
[
64
'path'
=>
'c?nf[aio]g{-,}[!0-9/]*.{p,}html'
,
65
'expectedPattern'
=>
'c[^/]nf[aio]g(?:\\-|)[^0-9/][^/]*\\.(?:p|)html'
66
]
67
];
68
}
69
}
Magento\Framework\View\Test\Unit\Helper\PathPatternTest\testTranslatePatternFromGlob
testTranslatePatternFromGlob($path, $expectedPattern)
Definition:
PathPatternTest.php:36
Magento\Framework\View\Test\Unit\Helper\PathPatternTest\setUp
setUp()
Definition:
PathPatternTest.php:22
Magento\Framework\View\Test\Unit\Helper\PathPatternTest\translatePatternFromGlobDataProvider
translatePatternFromGlobDataProvider()
Definition:
PathPatternTest.php:44
Magento\Framework\View\Test\Unit\Helper\PathPatternTest
Definition:
PathPatternTest.php:10
Magento\Framework\View\Test\Unit\Helper\PathPatternTest\$objectManagerHelper
$objectManagerHelper
Definition:
PathPatternTest.php:20
Magento\Framework\View\Test\Unit\Helper
Definition:
JsTest.php:6
Magento
Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Definition:
ObjectManager.php:13
Magento\Framework\View\Test\Unit\Helper\PathPatternTest\$pathPatternHelper
$pathPatternHelper
Definition:
PathPatternTest.php:15
$path
$path
Definition:
import_with_filesystem_images.php:14