Skip to content

Commit 210f1b4

Browse files
author
Sergii Kovalenko
committed
MAGETWO-89402: Make 'db:status' command works properly
--fix static tests
1 parent 551e937 commit 210f1b4

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/Definition/Constraints/ForeignKey.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public function toDefinition(ElementInterface $foreignKey)
7474
public function fromDefinition(array $data)
7575
{
7676
if (!isset($data['Create Table'])) {
77-
throw new LocalizedException(__('Can`t read foreign keys from current database'));
77+
throw new LocalizedException(
78+
new \Magento\Framework\Phrase('Can`t read foreign keys from current database')
79+
);
7880
}
7981

8082
$createMySQL = $data['Create Table'];

lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/ElementInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
* Is parent interface for all various schema structural elements:
1212
* table, column, constraint, index.
13+
* @api
1314
*/
1415
interface ElementInterface
1516
{

lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/CheckReferenceColumnHasIndexTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,25 @@ protected function setUp()
3333

3434
public function testValidate()
3535
{
36-
$table = new Table('name', 'name', 'table', 'default', 'innodb');
36+
$table = new Table(
37+
'name',
38+
'name',
39+
'table',
40+
'default',
41+
'innodb',
42+
'utf-8',
43+
'utf-8',
44+
''
45+
);
3746
$refTable = new Table(
3847
'ref_table',
3948
'name',
4049
'table',
4150
'default',
42-
'innodb'
51+
'innodb',
52+
'utf-8',
53+
'utf-8',
54+
''
4355
);
4456

4557
$column = new Real('decimal', 'decimal', $table, 10, 5);

lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/RealTypesTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ protected function setUp()
3232

3333
public function testValidate()
3434
{
35-
$table = new Table('name', 'name', 'table', 'default', 'innodb');
35+
$table = new Table(
36+
'name',
37+
'name',
38+
'table',
39+
'default',
40+
'innodb',
41+
'utf-8',
42+
'utf-8',
43+
''
44+
);
3645
$okColumn = new Real('decimal', 'decimal', $table, 10, 5);
3746
$invalidColumn = new Real('float', 'float', $table, 5, 10);
3847
$table->addColumns([$okColumn, $invalidColumn]);

0 commit comments

Comments
 (0)