diff options
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/tests/bootstrap.php')
-rw-r--r-- | fai_gestion/plugins/CustomTheme/tests/bootstrap.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fai_gestion/plugins/CustomTheme/tests/bootstrap.php b/fai_gestion/plugins/CustomTheme/tests/bootstrap.php new file mode 100644 index 0000000..644321d --- /dev/null +++ b/fai_gestion/plugins/CustomTheme/tests/bootstrap.php @@ -0,0 +1,30 @@ +<?php +/** + * Test suite bootstrap for CustomTheme. + * + * This function is used to find the location of CakePHP whether CakePHP + * has been installed as a dependency of the plugin, or the plugin is itself + * installed as a dependency of an application. + */ +$findRoot = function ($root) { + do { + $lastRoot = $root; + $root = dirname($root); + if (is_dir($root . '/vendor/cakephp/cakephp')) { + return $root; + } + } while ($root !== $lastRoot); + + throw new Exception("Cannot find the root of the application, unable to run tests"); +}; +$root = $findRoot(__FILE__); +unset($findRoot); + +chdir($root); + +if (file_exists($root . '/config/bootstrap.php')) { + require $root . '/config/bootstrap.php'; + + return; +} +require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php'; |