Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Functions | Variables
bootstrap.php File Reference

Go to the source code of this file.

Functions

catch(\Exception $e) setCustomErrorHandler ()
 

Variables

 $testsBaseDir = dirname(__DIR__)
 
 $integrationTestsDir = realpath("{$testsBaseDir}/../integration")
 
 $fixtureBaseDir = $integrationTestsDir . '/testsuite'
 
if(!defined('TESTS_TEMP_DIR')) if(!defined('INTEGRATION_TESTS_DIR')) try
 
 $settings = new \Magento\TestFramework\Bootstrap\Settings($testsBaseDir, get_defined_constants())
 
if($settings->get('TESTS_EXTRA_VERBOSE_LOG')) else
 
 $testFrameworkDir = __DIR__
 
 $installConfigFile = $settings->getAsConfigFile('TESTS_INSTALL_CONFIG_FILE')
 
if(!file_exists($installConfigFile)) $globalConfigFile = $settings->getAsConfigFile('TESTS_GLOBAL_CONFIG_FILE')
 
if(!file_exists($installConfigFile)) $dirList = new \Magento\Framework\App\Filesystem\DirectoryList(BP)
 
 $application
 
if(defined('TESTS_MAGENTO_INSTALLATION') &&TESTS_MAGENTO_INSTALLATION==='enabled') $bootstrap
 
 $dirSearch
 
 $themePackageList
 

Function Documentation

◆ setCustomErrorHandler()

catch (\Exception $e) setCustomErrorHandler ( )

Set custom error handler

Definition at line 106 of file bootstrap.php.

107 {
108  set_error_handler(
109  function ($errNo, $errStr, $errFile, $errLine) {
110  if (error_reporting()) {
111  $errorNames = [
112  E_ERROR => 'Error',
113  E_WARNING => 'Warning',
114  E_PARSE => 'Parse',
115  E_NOTICE => 'Notice',
116  E_CORE_ERROR => 'Core Error',
117  E_CORE_WARNING => 'Core Warning',
118  E_COMPILE_ERROR => 'Compile Error',
119  E_COMPILE_WARNING => 'Compile Warning',
120  E_USER_ERROR => 'User Error',
121  E_USER_WARNING => 'User Warning',
122  E_USER_NOTICE => 'User Notice',
123  E_STRICT => 'Strict',
124  E_RECOVERABLE_ERROR => 'Recoverable Error',
125  E_DEPRECATED => 'Deprecated',
126  E_USER_DEPRECATED => 'User Deprecated',
127  ];
128 
129  $errName = isset($errorNames[$errNo]) ? $errorNames[$errNo] : "";
130 
131  throw new \PHPUnit\Framework\Exception(
132  sprintf("%s: %s in %s:%s.", $errName, $errStr, $errFile, $errLine),
133  $errNo
134  );
135  }
136  }
137  );
138 }

Variable Documentation

◆ $application

$application
Initial value:
= new \Magento\TestFramework\WebApiApplication(
$dirList->getPath(DirectoryList::VAR_DIR),
BP . '/app/etc/',
$settings->get('TESTS_MAGENTO_MODE'),
AutoloaderRegistry::getAutoloader()
)
if(!file_exists($installConfigFile)) $dirList
Definition: bootstrap.php:57
if(!file_exists($installConfigFile)) if(!defined('TESTS_INSTALLATION_DB_CONFIG_FILE')) $shell
Definition: bootstrap.php:46
if(!file_exists($installConfigFile)) $globalConfigFile
Definition: bootstrap.php:53
$settings
Definition: bootstrap.php:29
const BP
Definition: autoload.php:14
$installConfigFile
Definition: bootstrap.php:49

Definition at line 58 of file bootstrap.php.

◆ $bootstrap

if (defined( 'TESTS_MAGENTO_INSTALLATION') &&TESTS_MAGENTO_INSTALLATION==='enabled') $bootstrap
Initial value:
= new \Magento\TestFramework\Bootstrap(
new \Magento\TestFramework\Bootstrap\Environment(),
new \Magento\TestFramework\Bootstrap\WebapiDocBlock("{$integrationTestsDir}/testsuite"),
new \Magento\TestFramework\Bootstrap\Profiler(new \Magento\Framework\Profiler\Driver\Standard()),
new \Magento\TestFramework\Bootstrap\MemoryFactory($shell)
)
if(!file_exists($installConfigFile)) if(!defined('TESTS_INSTALLATION_DB_CONFIG_FILE')) $shell
Definition: bootstrap.php:46
$application
Definition: bootstrap.php:58
$settings
Definition: bootstrap.php:29

Definition at line 73 of file bootstrap.php.

◆ $dirList

if (!file_exists( $installConfigFile)) $dirList = new \Magento\Framework\App\Filesystem\DirectoryList(BP)

Definition at line 57 of file bootstrap.php.

◆ $dirSearch

$dirSearch
Initial value:

Definition at line 86 of file bootstrap.php.

◆ $fixtureBaseDir

$fixtureBaseDir = $integrationTestsDir . '/testsuite'

Definition at line 15 of file bootstrap.php.

◆ $globalConfigFile

if (!file_exists( $installConfigFile)) $globalConfigFile = $settings->getAsConfigFile('TESTS_GLOBAL_CONFIG_FILE')

Definition at line 53 of file bootstrap.php.

◆ $installConfigFile

$installConfigFile = $settings->getAsConfigFile('TESTS_INSTALL_CONFIG_FILE')

Definition at line 49 of file bootstrap.php.

◆ $integrationTestsDir

$integrationTestsDir = realpath("{$testsBaseDir}/../integration")

Definition at line 14 of file bootstrap.php.

◆ $settings

$settings = new \Magento\TestFramework\Bootstrap\Settings($testsBaseDir, get_defined_constants())

Definition at line 29 of file bootstrap.php.

◆ $testFrameworkDir

$testFrameworkDir = __DIR__

Definition at line 46 of file bootstrap.php.

◆ $testsBaseDir

$testsBaseDir = dirname(__DIR__)

Definition at line 13 of file bootstrap.php.

◆ $themePackageList

$themePackageList
Initial value:
->create(\Magento\Framework\View\Design\Theme\ThemePackageList::class)

Definition at line 88 of file bootstrap.php.

◆ else

if ( $settings->get( 'TESTS_EXTRA_VERBOSE_LOG')) else
Initial value:
{
$shell = new \Magento\Framework\Shell(new \Magento\Framework\Shell\CommandRenderer())
if(!file_exists($installConfigFile)) if(!defined('TESTS_INSTALLATION_DB_CONFIG_FILE')) $shell
Definition: bootstrap.php:46

Definition at line 42 of file bootstrap.php.

◆ try

if (!defined( 'TESTS_TEMP_DIR')) if (!defined( 'INTEGRATION_TESTS_DIR')) try
Initial value:
{
catch(\Exception $e) setCustomErrorHandler()
Definition: bootstrap.php:106

Definition at line 25 of file bootstrap.php.