<commit_before><?php
/**
 * Part of CI PHPUnit Test
 *
 * @author     <NAME> <https://github.com/kenjis>
 * @license    MIT License
 * @copyright  2015 <NAME>
 * @link       https://github.com/kenjis/ci-phpunit-test
 */

class CIPHPUnitTest
{
	private static $loader_class = 'CI_Loader';

	public static function init()
	{
		// Fix CLI args
		$_server_backup = $_SERVER;
		$_SERVER['argv'] = [
			'index.php',
			'_dummy/_dummy'	// Force 404 route
		];
		$_SERVER['argc'] = 2;

		self::loadCIPHPUnitTestClasses();

		// Replace a few Common functions
		require __DIR__ . '/replacing/core/Common.php';
		require BASEPATH . 'core/Common.php';

		// Load new functions of CIPHPUnitTest
		require __DIR__ . '/functions.php';

		self::replaceLoader();<commit_msg>Workaround for missing CodeIgniter's error handler<commit_after><?php
/**
 * Part of CI PHPUnit Test
 *
 * @author     <NAME> <https://github.com/kenjis>
 * @license    MIT License
 * @copyright  2015 <NAME>
 * @link       https://github.com/kenjis/ci-phpunit-test
 */

class CIPHPUnitTest
{
	private static $loader_class = 'CI_Loader';

	public static function init()
	{
		// Fix CLI args
		$_server_backup = $_SERVER;
		$_SERVER['argv'] = [
			'index.php',
			'_dummy/_dummy'	// Force 404 route
		];
		$_SERVER['argc'] = 2;

		self::loadCIPHPUnitTestClasses();

		// Replace a few Common functions
		require __DIR__ . '/replacing/core/Common.php';
		require BASEPATH . 'core/Common.php';

		// Workaround for missing CodeIgniter's error handler
		// See https://github.com/kenjis/ci-phpunit-test/issues/37
		set_error_handler('_error_handler');

		// Load new functions of CIPHPUnitTest
		require __DIR__ . '/functions.php';

		self::replaceLoader();
{'fraction_non_alphanumeric': 0.14444444444444443, 'fraction_numerical': 0.010526315789473684, 'mean_word_length': 3.3759590792838874, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '367240', 'n_tokens_mistral': 635, 'n_tokens_neox': 567, 'n_words': 135}