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

Public Member Functions

 setUp ()
 
 testDryRunOnCleanDatabase ()
 
 testDryRunOnUpgrade ()
 
- Public Member Functions inherited from SetupTestCase
 setData (array $data)
 
 flushData ()
 
 getData ()
 

Detailed Description

The purpose of this test is verifying declarative installation works.

Definition at line 18 of file DryRunTest.php.

Member Function Documentation

◆ setUp()

setUp ( )

Definition at line 30 of file DryRunTest.php.

31  {
33  $this->moduleManager = $objectManager->get(TestModuleManager::class);
34  $this->cliCommad = $objectManager->get(CliCommand::class);
35  }
$objectManager
Definition: bootstrap.php:17

◆ testDryRunOnCleanDatabase()

testDryRunOnCleanDatabase ( )

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

Definition at line 41 of file DryRunTest.php.

42  {
43  $logFileName = TESTS_TEMP_DIR . '/var/log/' . DryRunLogger::FILE_NAME;
44  $this->cliCommad->install(
45  ['Magento_TestSetupDeclarationModule1'],
46  ['dry-run' => true]
47  );
48  self::assertFileExists($logFileName);
49  $data = file_get_contents($logFileName);
50  self::assertEquals($data, $this->getData()[0]);
51  }

◆ testDryRunOnUpgrade()

testDryRunOnUpgrade ( )

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

Definition at line 57 of file DryRunTest.php.

58  {
59  $logFileName = TESTS_TEMP_DIR . '/var/log/' . DryRunLogger::FILE_NAME;
60  $this->cliCommad->install(['Magento_TestSetupDeclarationModule1']);
61  $this->moduleManager->updateRevision(
62  'Magento_TestSetupDeclarationModule1',
63  'column_modifications',
64  'db_schema.xml',
65  'etc'
66  );
67  $this->cliCommad->upgrade(['dry-run' => true]);
68  self::assertFileExists($logFileName);
69  $data = file_get_contents($logFileName);
70  self::assertEquals($data, $this->getData()[0]);
71  }

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