Add additional configuration options to codeception

This updates the codeception unit tests to remove the LEGACY_PATH constant and to define legacy test runners so that we can test session related methods.
This commit is contained in:
Dillon-Brown 2020-01-28 16:24:51 +00:00
parent 8cf555f4ee
commit ece6ae6377
4 changed files with 32 additions and 20 deletions

View file

@ -1,2 +1,2 @@
#!/bin/sh
../vendor/bin/phpunit
../vendor/bin/codecept

View file

@ -1,17 +1,20 @@
<?php
if (!defined('LEGACY_PATH')) {
define('LEGACY_PATH', dirname(__DIR__, 2) . '/legacy/');
}
error_reporting(E_ALL);
// Set up sugarEntry
// Bootstrap composer
require_once __DIR__ . '/../../vendor/autoload.php';
chdir(__DIR__ . '/../../legacy');
// Bootstrap SuiteCRM
if (!defined('sugarEntry')) {
define('sugarEntry', true);
define('SUITE_PHPUNIT_RUNNER', true);
}
// Set working directory for legacy
chdir(LEGACY_PATH);
// Load in legacy
require_once LEGACY_PATH . 'include/MVC/preDispatch.php';
require_once LEGACY_PATH . 'include/entryPoint.php';
require_once __DIR__ . '/../../legacy/include/utils.php';
require_once __DIR__ . '/../../legacy/include/modules.php';
require_once __DIR__ . '/../../legacy/include/MVC/preDispatch.php';
require_once __DIR__ . '/../../legacy/include/entryPoint.php';

View file

@ -12,7 +12,7 @@ final class NavbarTest extends Unit
*/
private $navbar;
protected function setUp(): void
protected function _before()
{
$this->navbar = new Navbar();
}