Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SchemaReaderTest.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Setup;
8 
13 
18 {
22  private $reader;
23 
27  private $moduleManager;
28 
29  public function setUp()
30  {
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,
59  'etc'
60  );
61  }
62 
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 }
$objectManager
Definition: bootstrap.php:17