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__)
 
 $fixtureBaseDir = $testsBaseDir. '/testsuite'
 
if(!defined('TESTS_TEMP_DIR')) if(!defined('INTEGRATION_TESTS_DIR')) $testFrameworkDir = __DIR__
 
 try
 
 $settings = new \Magento\TestFramework\Bootstrap\Settings($testsBaseDir, get_defined_constants())
 
if($settings->get('TESTS_EXTRA_VERBOSE_LOG')) else
 
 $installConfigFile = $settings->getAsConfigFile('TESTS_INSTALL_CONFIG_FILE')
 
if(!file_exists($installConfigFile)) $globalConfigFile = $settings->getAsConfigFile('TESTS_GLOBAL_CONFIG_FILE')
 
if(!file_exists($globalConfigFile)) $sandboxUniqueId = md5(sha1_file($installConfigFile))
 
 $installDir = TESTS_TEMP_DIR . "/sandbox-{$settings->get('TESTS_PARALLEL_THREAD', 0)}-{$sandboxUniqueId}"
 
 $application
 
 $bootstrap
 
 $dirSearch
 
 $themePackageList
 

Function Documentation

◆ setCustomErrorHandler()

catch (\Exception $e) setCustomErrorHandler ( )

Set custom error handler

Definition at line 109 of file bootstrap.php.

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

Variable Documentation

◆ $application

$application
Initial value:
= new \Magento\TestFramework\Application(
$settings->get('TESTS_GLOBAL_CONFIG_DIR'),
$settings->get('TESTS_MAGENTO_MODE'),
AutoloaderRegistry::getAutoloader(),
true
)
if(!file_exists($installConfigFile)) if(!defined('TESTS_INSTALLATION_DB_CONFIG_FILE')) $shell
Definition: bootstrap.php:46
$installDir
Definition: bootstrap.php:55
if(!file_exists($installConfigFile)) $globalConfigFile
Definition: bootstrap.php:53
$settings
Definition: bootstrap.php:29
$installConfigFile
Definition: bootstrap.php:49

Definition at line 56 of file bootstrap.php.

◆ $bootstrap

$bootstrap
Initial value:
= new \Magento\TestFramework\Bootstrap(
new \Magento\TestFramework\Bootstrap\Environment(),
new \Magento\TestFramework\Bootstrap\DocBlock("{$testsBaseDir}/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 67 of file bootstrap.php.

◆ $dirSearch

$dirSearch
Initial value:

Definition at line 87 of file bootstrap.php.

◆ $fixtureBaseDir

$fixtureBaseDir = $testsBaseDir. '/testsuite'

Definition at line 12 of file bootstrap.php.

◆ $globalConfigFile

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

Definition at line 50 of file bootstrap.php.

◆ $installConfigFile

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

Definition at line 46 of file bootstrap.php.

◆ $installDir

$installDir = TESTS_TEMP_DIR . "/sandbox-{$settings->get('TESTS_PARALLEL_THREAD', 0)}-{$sandboxUniqueId}"

Definition at line 55 of file bootstrap.php.

◆ $sandboxUniqueId

if (!file_exists( $globalConfigFile)) $sandboxUniqueId = md5(sha1_file($installConfigFile))

Definition at line 54 of file bootstrap.php.

◆ $settings

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

Definition at line 29 of file bootstrap.php.

◆ $testFrameworkDir

if (!defined( 'TESTS_TEMP_DIR')) if (!defined( 'INTEGRATION_TESTS_DIR')) $testFrameworkDir = __DIR__

Definition at line 22 of file bootstrap.php.

◆ $testsBaseDir

$testsBaseDir = dirname(__DIR__)

Definition at line 11 of file bootstrap.php.

◆ $themePackageList

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

Definition at line 89 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

try
Initial value:
{
catch(\Exception $e) setCustomErrorHandler()
Definition: bootstrap.php:106

Definition at line 25 of file bootstrap.php.