Skip to content

Instantly share code, notes, and snippets.

@agarzon
Created November 5, 2014 14:40
Show Gist options
  • Save agarzon/0d888a431eb24e9913ff to your computer and use it in GitHub Desktop.
Save agarzon/0d888a431eb24e9913ff to your computer and use it in GitHub Desktop.
CakePHP helper for Codeception (Unit testing)
<?php
namespace Codeception\Module;
class CakePHPHelper extends \Codeception\Module
{
public function __construct()
{
define('APP_DIR', 'app');
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', getcwd());
define('WEBROOT_DIR', 'webroot');
define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
}
require CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php';
}
}
@agarzon
Copy link
Author

agarzon commented Nov 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment