euromark 11 年之前
父节点
当前提交
72766e7ed1
共有 1 个文件被更改,包括 17 次插入6 次删除
  1. 17 6
      Test/bootstrap.php

+ 17 - 6
Test/bootstrap.php

@@ -1,12 +1,23 @@
 <?php
-/**
- * Test runner bootstrap.
- *
- * Add additional configuration/setup your application needs when running
- * unit tests in this file.
- */
 //require dirname(__DIR__) . '/../Config/bootstrap.php';
 
+function find_root() {
+	$root = dirname(__DIR__);
+	if (is_dir($root . '/vendor/cakephp/cakephp')) {
+		return $root;
+	}
+
+	$root = dirname(dirname(__DIR__));
+	if (is_dir($root . '/vendor/cakephp/cakephp')) {
+		return $root;
+	}
+
+	$root = dirname(dirname(dirname(__DIR__)));
+	if (is_dir($root . '/vendor/cakephp/cakephp')) {
+		return $root;
+	}
+}
+
 define('DS', DIRECTORY_SEPARATOR);
 define('ROOT', dirname(dirname(dirname(dirname(__FILE__)))));
 define('APP_DIR', 'App');