Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
SchemaReaderTest Class Reference
Inheritance diagram for SchemaReaderTest:
SetupTestCase MutableDataInterface

Public Member Functions

 setUp ()
 
 testSuccessfullRead ()
 
 testFailOnInvalidColumnDeclaration ()
 
 testForeignKeyInterpreter ()
 
- Public Member Functions inherited from SetupTestCase
 setData (array $data)
 
 flushData ()
 
 getData ()
 

Detailed Description

The purpose of this test is validating schema reader operations.

Definition at line 17 of file SchemaReaderTest.php.

Member Function Documentation

◆ setUp()

setUp ( )

Definition at line 29 of file SchemaReaderTest.php.

30  {
32  $this->reader = $objectManager->get(ReaderComposite::class);
33  $this->moduleManager = $objectManager->get(TestModuleManager::class);
34  }
$objectManager
Definition: bootstrap.php:17

◆ testFailOnInvalidColumnDeclaration()

testFailOnInvalidColumnDeclaration ( )

@expectedException \Magento\Framework\Exception\LocalizedException @expectedExceptionMessageRegExp /The attribute 'scale' is not allowed./ @moduleName Magento_TestSetupDeclarationModule1

Definition at line 68 of file SchemaReaderTest.php.

69  {
70  $this->updateRevisionTo('fail_on_column_declaration');
71  $this->reader->read('all');
72  }

◆ testForeignKeyInterpreter()

testForeignKeyInterpreter ( )

@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/foreign_key_interpreter_result.php

Definition at line 78 of file SchemaReaderTest.php.

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  }

◆ testSuccessfullRead()

testSuccessfullRead ( )

@moduleName Magento_TestSetupDeclarationModule1 @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/valid_xml_revision_1.php

Definition at line 40 of file SchemaReaderTest.php.

41  {
42  $schema = $this->reader->read('all');
43  unset($schema['table']['patch_list']);
44  self::assertEquals($this->getData(), $schema);
45  }

The documentation for this class was generated from the following file: