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
setup-integration
testsuite
Magento
Setup
SchemaReaderTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Setup
;
8
9
use
Magento\Framework\Setup\Declaration\Schema\Declaration\ReaderComposite
;
10
use
Magento\TestFramework\Deploy\TestModuleManager
;
11
use
Magento\TestFramework\Helper\Bootstrap
;
12
use
Magento\TestFramework\TestCase\SetupTestCase
;
13
17
class
SchemaReaderTest
extends
SetupTestCase
18
{
22
private
$reader;
23
27
private
$moduleManager;
28
29
public
function
setUp
()
30
{
31
$objectManager
=
Bootstrap::getObjectManager
();
32
$this->reader =
$objectManager
->get(ReaderComposite::class);
33
$this->moduleManager =
$objectManager
->get(TestModuleManager::class);
34
}
35
40
public
function
testSuccessfullRead
()
41
{
42
$schema
= $this->reader->read(
'all'
);
43
unset(
$schema
[
'table'
][
'patch_list'
]);
44
self::assertEquals($this->
getData
(),
$schema
);
45
}
46
53
private
function
updateRevisionTo($revisionName)
54
{
55
$this->moduleManager->updateRevision(
56
'Magento_TestSetupDeclarationModule1'
,
57
$revisionName,
58
TestModuleManager::DECLARATIVE_FILE_NAME
,
59
'etc'
60
);
61
}
62
68
public
function
testFailOnInvalidColumnDeclaration
()
69
{
70
$this->updateRevisionTo(
'fail_on_column_declaration'
);
71
$this->reader->read(
'all'
);
72
}
73
78
public
function
testForeignKeyInterpreter
()
79
{
80
$this->updateRevisionTo(
'foreign_key_interpreter'
);
81
$schema
= $this->reader->read(
'all'
);
82
unset(
$schema
[
'table'
][
'patch_list'
]);
83
self::assertEquals($this->
getData
(),
$schema
);
84
}
85
}
Magento\Setup\SchemaReaderTest\testForeignKeyInterpreter
testForeignKeyInterpreter()
Definition:
SchemaReaderTest.php:78
$objectManager
$objectManager
Definition:
bootstrap.php:17
Magento\TestFramework\Helper\Bootstrap
Definition:
Bootstrap.php:12
Magento\Framework\Setup\Declaration\Schema\Declaration\ReaderComposite
Definition:
ReaderComposite.php:17
Magento\TestFramework\Deploy\TestModuleManager\DECLARATIVE_FILE_NAME
const DECLARATIVE_FILE_NAME
Definition:
TestModuleManager.php:20
Magento\TestFramework\TestCase\SetupTestCase\getData
getData()
Definition:
SetupTestCase.php:40
Magento\Setup\SchemaReaderTest
Definition:
SchemaReaderTest.php:17
Magento\TestFramework\TestCase\SetupTestCase
Definition:
SetupTestCase.php:14
Magento\Setup
Magento\TestFramework\Deploy\TestModuleManager
Definition:
TestModuleManager.php:15
Magento\Setup\SchemaReaderTest\testSuccessfullRead
testSuccessfullRead()
Definition:
SchemaReaderTest.php:40
$schema
$schema
Definition:
configured_price.phtml:9
Magento\Setup\SchemaReaderTest\setUp
setUp()
Definition:
SchemaReaderTest.php:29
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125
Magento\Setup\SchemaReaderTest\testFailOnInvalidColumnDeclaration
testFailOnInvalidColumnDeclaration()
Definition:
SchemaReaderTest.php:68