bootstrap.php 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?php

if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
    // Dependencies were installed with Composer and this is the main project
    $loader = require_once __DIR__ . '/../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../../../../autoload.php')) {
    // We're installed as a dependency in another project's `vendor` directory
    $loader = require_once __DIR__ . '/../../../../autoload.php';
} else {
    throw new Exception('Can\'t find autoload.php. Did you install dependencies with Composer?');
}
12

13
if (! class_exists(PHPUnit\Framework\Error\Warning::class)) {
14
    class_alias(PHPUnit_Framework_Error_Warning::class, PHPUnit\Framework\Error\Warning::class);
15
}
16

17
if (! class_exists(PHPUnit\Framework\Constraint\Constraint::class)) {
18
    class_alias(PHPUnit_Framework_Constraint::class, PHPUnit\Framework\Constraint\Constraint::class);
19
}
20

21
if (! class_exists(PHPUnit\Framework\ExpectationFailedException::class)) {
22 23
    class_alias(PHPUnit_Framework_ExpectationFailedException::class, PHPUnit\Framework\ExpectationFailedException::class);
}