Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
bootstrap.php
Go to the documentation of this file.
1 <?php
14 
15 require __DIR__ . '/autoload.php';
16 
17 if (!defined('TESTS_TEMP_DIR')) {
18  define('TESTS_TEMP_DIR', __DIR__ . DIRECTORY_SEPARATOR . 'tmp');
19 }
20 
22 
26 $serializer = new \Magento\Framework\Serialize\Serializer\Json();
30 );
31 
36 {
37  set_error_handler(
38  function ($errNo, $errStr, $errFile, $errLine) {
39  if (error_reporting()) {
40  $errorNames = [
41  E_ERROR => 'Error',
42  E_WARNING => 'Warning',
43  E_PARSE => 'Parse',
44  E_NOTICE => 'Notice',
45  E_CORE_ERROR => 'Core Error',
46  E_CORE_WARNING => 'Core Warning',
47  E_COMPILE_ERROR => 'Compile Error',
48  E_COMPILE_WARNING => 'Compile Warning',
49  E_USER_ERROR => 'User Error',
50  E_USER_WARNING => 'User Warning',
51  E_USER_NOTICE => 'User Notice',
52  E_STRICT => 'Strict',
53  E_RECOVERABLE_ERROR => 'Recoverable Error',
54  E_DEPRECATED => 'Deprecated',
55  E_USER_DEPRECATED => 'User Deprecated',
56  ];
57 
58  $errName = isset($errorNames[$errNo]) ? $errorNames[$errNo] : "";
59 
60  throw new \PHPUnit\Framework\Exception(
61  sprintf("%s: %s in %s:%s.", $errName, $errStr, $errFile, $errLine),
62  $errNo
63  );
64  }
65  }
66  );
67 }
$componentRegistrar
Definition: bootstrap.php:23
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
$serializer
Definition: bootstrap.php:26
$themePackageList
Definition: bootstrap.php:88
static setInstance(Files $instance=null)
Definition: Files.php:136
$dirSearch
Definition: bootstrap.php:86
$regexIteratorFactory
Definition: bootstrap.php:27
catch(\Exception $e) setCustomErrorHandler()
Definition: bootstrap.php:106