euromark 11 years ago
parent
commit
72766e7ed1
1 changed files with 17 additions and 6 deletions
  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');