signed

QiShunwang

“诚信为本、客户至上”

【Laravel3.0.0源码阅读分析】单元测试phpunit.php

2021/6/9 7:41:49   来源:
<?php
/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @version  3.0.0
 * @author   Taylor Otwell <taylorotwell@gmail.com>
 * @link     http://laravel.com
 */

// --------------------------------------------------------------
// Define the directory separator for the environment.
// 定义环境的目录分隔符。
// --------------------------------------------------------------
define('DS', DIRECTORY_SEPARATOR);

// --------------------------------------------------------------
// Set the core Laravel path constants.
// Set the core Laravel path constants.
// --------------------------------------------------------------
require 'paths.php';

// --------------------------------------------------------------
// Override the application paths when testing the core.
// --------------------------------------------------------------
$config = file_get_contents('phpunit.xml');

if (strpos($config, 'laravel-tests') !== false)
{
	$path = path('bundle').'laravel-tests'.DS;

	set_path('app', $path.'application'.DS);

	set_path('bundle', $path.'bundles'.DS);

	set_path('storage', $path.'storage'.DS);
}

// --------------------------------------------------------------
// Bootstrap the Laravel core.
// 引导 Laravel 核心。
// --------------------------------------------------------------
require path('sys').'core.php';

// --------------------------------------------------------------
// Start the default bundle.
// 启动默认包。
// --------------------------------------------------------------
Bundle::start(DEFAULT_BUNDLE);

github地址: https://github.com/liu-shilong/laravel3-scr