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,13 +1,22 @@
namespace: App\Tests
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
actor_suffix: Tester
paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
settings:
memory_limit: 16000M
# Disable for faster test execution
lint: true
colors: true
backup_globals: true
report_useless_tests: true
disallow_test_output: true
# Significantly slows down test execution when true
be_strict_about_changes_to_global_state: false
extensions:
enabled:
- Codeception\Extension\RunFailed
enabled:
- Codeception\Extension\RunFailed
params:
- .env
- .env

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();
}