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
static
framework
tests
unit
testsuite
Magento
TestFramework
Dependency
DeclarativeSchemaRuleTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\TestFramework\Dependency
;
7
13
class
DeclarativeSchemaRuleTest
extends
\PHPUnit\Framework\TestCase
14
{
18
protected
$model
;
19
20
protected
function
setUp
()
21
{
22
$this->model =
new
DeclarativeSchemaRule
([
'some_table'
=>
'SomeModule'
]);
23
}
24
32
public
function
testGetDependencyInfo
($module, $file,
$contents
, array $expected)
33
{
34
$actualDependencies = $this->model->getDependencyInfo($module,
'db_schema'
, $file,
$contents
);
35
$this->assertEquals(
36
$expected,
37
$actualDependencies
38
);
39
}
40
41
public
function
getDependencyInfoDataProvider
()
42
{
43
return
[
44
[
'any'
,
'non-db-schema-file.php'
,
'any'
, []],
45
[
46
'any'
,
47
'/app/Magento/Module/etc/db_schema.xml'
,
48
'<table name="unknown_table"></table>'
,
49
[[
'module'
=>
'Unknown'
,
'source'
=>
'unknown_table'
]]
50
],
51
[
52
'SomeModule'
,
53
'/app/some/path/etc/db_schema.xml'
,
54
'<table name="some_table"></table>'
,
55
[]
56
],
57
[
58
'any'
,
59
'/app/some/path/etc/db_schema.xml'
,
60
'<table name="some_table"></table>'
,
61
[
62
[
63
'module'
=>
'SomeModule'
,
64
'type'
=>
\Magento\TestFramework\Dependency\RuleInterface::TYPE_HARD
,
65
'source'
=>
'some_table'
,
66
]
67
]
68
],
69
[
70
'any'
,
71
'/app/some/path/etc/db_schema.xml'
,
72
'<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
73
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
74
<table name="some_table">
75
<constraint xsi:type="foreign"
76
name="FK_NAME"
77
table="some_table"
78
column="some_col"
79
referenceTable="ref_table"
80
referenceColumn="ref_col"
81
onDelete="CASCADE"/>
82
</table>
83
</schema>'
,
84
[
85
[
86
'module'
=>
'SomeModule'
,
87
'type'
=>
\Magento\TestFramework\Dependency\RuleInterface::TYPE_HARD
,
88
'source'
=>
'some_table'
,
89
],
90
[
91
'module'
=>
'Unknown'
,
92
'source'
=>
'ref_table'
,
93
]
94
]
95
]
96
];
97
}
98
}
$contents
$contents
Definition:
website.php:14
Magento\TestFramework\Dependency\RuleInterface\TYPE_HARD
const TYPE_HARD
Definition:
RuleInterface.php:17
Magento\TestFramework\Dependency\DeclarativeSchemaRuleTest\setUp
setUp()
Definition:
DeclarativeSchemaRuleTest.php:20
Magento\TestFramework\Dependency\DeclarativeSchemaRule
Definition:
DeclarativeSchemaRule.php:15
Magento\TestFramework\Dependency\DeclarativeSchemaRuleTest
Definition:
DeclarativeSchemaRuleTest.php:13
Magento\TestFramework\Dependency\DeclarativeSchemaRuleTest\testGetDependencyInfo
testGetDependencyInfo($module, $file, $contents, array $expected)
Definition:
DeclarativeSchemaRuleTest.php:32
Magento\TestFramework\Dependency\DeclarativeSchemaRuleTest\getDependencyInfoDataProvider
getDependencyInfoDataProvider()
Definition:
DeclarativeSchemaRuleTest.php:41
Magento\TestFramework\Dependency\DeclarativeSchemaRuleTest\$model
$model
Definition:
DeclarativeSchemaRuleTest.php:18
Magento\TestFramework\Dependency
Definition:
DbRule.php:8