<commit_before><?php
namespace Craft;

class AuditLogTest extends BaseTest 
{
    
    public function setUp()
    {
    
        // PHPUnit complains about not settings this
        date_default_timezone_set('UTC');
    
        // Get dependencies
        $dir = __DIR__;
        $map = array(
            '\\Craft\\AuditLogModel'   => '/../models/AuditLogModel.php',
            '\\Craft\\AuditLogRecord'  => '/../records/AuditLogRecord.php',
            '\\Craft\\AuditLogService' => '/../services/AuditLogService.php'
        );

        // Inject them
        foreach($map as $classPath => $filePath) {
            if(!class_exists($classPath, false)) {
                require_once($dir . $filePath);
            }
        }
    
        // Set components we're going to use
        $this->setComponent(craft(), 'auditLog', new AuditLogService);
    
    } 
    
    public function testActionDownload() 
    {
    
        // Get first log item
        $log = craft()->auditLog->view(1);
        
        // Only test if already set
        if($log) {
        
            // $log is a model, want to break that down
            $result = craft()->auditLog->parseFieldData('title', $log);
            <commit_msg>Updated Unit Test setup<commit_after><?php
namespace Craft;

class AuditLogTest extends BaseTest 
{
    
    public function setUp()
    {
    
        // Load plugins
        $pluginsService = craft()->getComponent('plugins');
        $pluginsService->loadPlugins();
    
    } 
    
    public function testActionDownload() 
    {
    
        // Get first log item
        $log = craft()->auditLog->view(1);
        
        // Only test if already set
        if($log) {
        
            // $log is a model, want to break that down
            $result = craft()->auditLog->parseFieldData('title', $log);
            
{'fraction_non_alphanumeric': 0.12520325203252033, 'fraction_numerical': 0.001084010840108401, 'mean_word_length': 1.6522988505747127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '884634', 'n_tokens_mistral': 523, 'n_tokens_neox': 516, 'n_words': 121}