summaryrefslogtreecommitdiff
path: root/fai_gestion/plugins/CustomTheme/tests/bootstrap.php
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-16 13:24:18 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-16 13:26:14 +0200
commit31a40cfc446c9586f89a4aa69ef76d76d469e5a4 (patch)
treea68141ff714b1e91027d551d38fabc792bd498e7 /fai_gestion/plugins/CustomTheme/tests/bootstrap.php
parentc9939556d486da50f180ce424dd456252b1e0349 (diff)
downloadchd_gestion-31a40cfc446c9586f89a4aa69ef76d76d469e5a4.zip
chd_gestion-31a40cfc446c9586f89a4aa69ef76d76d469e5a4.tar.gz
chd_gestion-31a40cfc446c9586f89a4aa69ef76d76d469e5a4.tar.bz2
Bake : setup and create empty CustomTheme
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/tests/bootstrap.php')
-rw-r--r--fai_gestion/plugins/CustomTheme/tests/bootstrap.php30
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';