예제 #1
0
function bootstrapLaravel()
{
    $laravel = findTestLaravelInstallation();
    if (file_exists("{$laravel}/bootstrap/start.php")) {
        // Laravel 4
        $app = (require "{$laravel}/bootstrap/start.php");
        $app->boot();
        return $app;
    } else {
        // Laravel 5
        require_once "{$laravel}/bootstrap/autoload.php";
        $app = (require_once "{$laravel}/bootstrap/app.php");
        if (is_bool($app)) {
            return $app;
        }
        $app->make(\Illuminate\Contracts\Console\Kernel::class);
        $kernel = $app->make(\Illuminate\Contracts\Console\Kernel::class);
        $kernel->bootstrap();
        return $app;
    }
}
예제 #2
0
<?php

namespace Tacone\DataSource\Test;

require_once 'laravel.php';
$laravelFolder = findTestLaravelInstallation();
require_once __DIR__ . '/../../vendor/autoload.php';
require_once "{$laravelFolder}/vendor/autoload.php";
// I don't know how to include Framework/Assert/Functions.php
// and I don't give a dime.
foreach (get_class_methods(\Tacone\DataSource\Test\BaseTestCase::class) as $method) {
    if (strpos($method, 'assert') === 0) {
        if (!function_exists($method)) {
            eval("\n                    function {$method}()\n                    {\n                        return call_user_func_array(\n                            'PHPUnit_Framework_Assert::{$method}',\n                            func_get_args()\n                        );\n                    }\n                    ");
        }
    }
}
require_once 'functions.php';