Skip to content

Instantly share code, notes, and snippets.

@jtraulle
Created August 13, 2016 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtraulle/9b0bb8759d069914a2a7c6c10b680313 to your computer and use it in GitHub Desktop.
Save jtraulle/9b0bb8759d069914a2a7c6c10b680313 to your computer and use it in GitHub Desktop.
Bootstrap codeception cakephp
<?php
// Here you can initialize variables that will be available to your tests, e.g. the app's bootstrap.php
$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);
require $root . '/config/bootstrap.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment