winter/tests/bootstrap.php

33 lines
798 B
PHP
Raw Normal View History

<?php
/*
* October autoloader
*/
require __DIR__ . '/../bootstrap/autoload.php';
/*
* Fallback autoloader
*/
2017-06-08 18:56:54 +10:00
$loader = new October\Rain\Support\ClassLoader(
new October\Rain\Filesystem\Filesystem,
2017-07-27 14:01:27 +10:00
__DIR__ . '/../',
__DIR__ . '/../storage/framework/classes.php'
2017-06-08 18:56:54 +10:00
);
$loader->register();
$loader->addDirectories([
'modules',
'plugins'
]);
/*
* Monkey patch PHPUnit\Framework\MockObject\Generator to avoid
* "Function ReflectionType::__toString() is deprecated" warnings
*/
$generatorPatchPath = __DIR__ . '/resources/patches/php-generator-7.php';
$generatorSourcePath = __DIR__ . '/../vendor/phpunit/phpunit-mock-objects/src/Generator.php';
if (file_exists($generatorSourcePath)) {
file_put_contents($generatorSourcePath, file_get_contents($generatorPatchPath));
}