Skip to content

Commit 2b9413a

Browse files
committed
MAGETWO-92929: Declarative schema tests are located in inappropriate
- fix test
1 parent 3bb1494 commit 2b9413a

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

lib/internal/Magento/Framework/Setup/Test/Unit/SchemaListenerTest.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Framework\Setup\Test\Unit;
89

@@ -30,7 +31,7 @@ class SchemaListenerTest extends \PHPUnit\Framework\TestCase
3031
*/
3132
private $objectManagerHelper;
3233

33-
protected function setUp()
34+
protected function setUp() : void
3435
{
3536
$this->objectManagerHelper = new ObjectManagerHelper($this);
3637
$this->model = $this->objectManagerHelper->getObject(
@@ -51,7 +52,7 @@ protected function setUp()
5152
/**
5253
* @return Table
5354
*/
54-
private function getCreateTableDDL($tableName)
55+
private function getCreateTableDDL($tableName) : Table
5556
{
5657
$table = new Table();
5758
$table->setName($tableName);
@@ -91,7 +92,7 @@ private function getCreateTableDDL($tableName)
9192
);
9293
}
9394

94-
public function testRenameTable()
95+
public function testRenameTable() : void
9596
{
9697
$this->model->setModuleName('First_Module');
9798
$this->model->createTable($this->getCreateTableDDL('old_table'));
@@ -101,15 +102,15 @@ public function testRenameTable()
101102
self::assertArrayNotHasKey('old_table', $tables['First_Module']);
102103
}
103104

104-
public function testDropIndex()
105+
public function testDropIndex() : void
105106
{
106107
$this->model->setModuleName('First_Module');
107108
$this->model->createTable($this->getCreateTableDDL('index_table'));
108109
$this->model->dropIndex('index_table', 'INDEX_KEY', 'index');
109110
self::assertTrue($this->model->getTables()['First_Module']['index_table']['indexes']['INDEX_KEY']['disabled']);
110111
}
111112

112-
public function testCreateTable()
113+
public function testCreateTable() : void
113114
{
114115
$this->model->setModuleName('First_Module');
115116
$this->model->createTable($this->getCreateTableDDL('new_table'));
@@ -201,7 +202,7 @@ public function testCreateTable()
201202
);
202203
}
203204

204-
public function testDropTable()
205+
public function testDropTable() : void
205206
{
206207
$this->model->setModuleName('Old_Module');
207208
$this->model->createTable($this->getCreateTableDDL('old_table'));
@@ -210,7 +211,7 @@ public function testDropTable()
210211
self::assertTrue($this->model->getTables()['New_Module']['old_table']['disabled']);
211212
}
212213

213-
public function testDropTableInSameModule()
214+
public function testDropTableInSameModule() : void
214215
{
215216
$this->model->setModuleName('Old_Module');
216217
$this->model->createTable($this->getCreateTableDDL('old_table'));

lib/internal/Magento/Framework/Setup/Test/Unit/SchemaPersistorTest.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Framework\Setup\Test\Unit;
89

@@ -38,7 +39,7 @@ class SchemaPersistorTest extends \PHPUnit\Framework\TestCase
3839
*/
3940
private $xmlPersistor;
4041

41-
protected function setUp()
42+
protected function setUp() : void
4243
{
4344
$this->componentRegistrarMock = $this->getMockBuilder(ComponentRegistrar::class)
4445
->disableOriginalConstructor()
@@ -60,7 +61,7 @@ protected function setUp()
6061
* @param array $tables
6162
* @param string $expectedXML
6263
*/
63-
public function testPersist(array $tables, $expectedXML)
64+
public function testPersist(array $tables, $expectedXML) : void
6465
{
6566
$moduleName = 'First_Module';
6667
/** @var SchemaListener|\PHPUnit_Framework_MockObject_MockObject $schemaListenerMock */
@@ -88,7 +89,7 @@ public function testPersist(array $tables, $expectedXML)
8889
*
8990
* @return array
9091
*/
91-
public function schemaListenerTablesDataProvider()
92+
public function schemaListenerTablesDataProvider() : array
9293
{
9394
return [
9495
[

0 commit comments

Comments
 (0)