<commit_before><?php
/**
 * OWASP Enterprise Security API (ESAPI)
 * 
 * This file is part of the Open Web Application Security Project (OWASP)
 * Enterprise Security API (ESAPI) project. For details, please see
 * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>.
 *
 * Copyright (c) 2007 - 2009 The OWASP Foundation
 * 
 * The ESAPI is published by OWASP under the BSD license. You should read and accept the
 * LICENSE before you use, modify, and/or redistribute this software.
 * 
 * @author <NAME> (<EMAIL> @ <EMAIL>)
 * @created 2009
 * @since 1.6
 */
 
 

require_once __DIR__.'/../../src/ESAPI.php';
require_once __DIR__.'/../../src/reference/DefaultRandomizer.php';

class RandomizerTest extends PHPUnit_Framework_TestCase
{
	private $CHAR_ALPHANUMERICS = 'abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ01234567890';
	
	function setUp() 
	{
		global $ESAPI;
		
		if ( !isset($ESAPI)) 
		{
			$ESAPI = new ESAPI(dirname(__FILE__).'/../testresources/ESAPI.xml');
		}	
	}
	
	function tearDown()
	{
		
	}

    /**
     * Test of getRandomGUID method, of class org.owasp.esapi.Randomizer.
     * @throws EncryptionException
     */
    function testGetRandomGUID() {
        
        $instance = ESAPI::getRandomizer();<commit_msg>Replace 'dirname(__FILE__)' by '__DIR__'<commit_after><?php
/**
 * OWASP Enterprise Security API (ESAPI)
 * 
 * This file is part of the Open Web Application Security Project (OWASP)
 * Enterprise Security API (ESAPI) project. For details, please see
 * <a href="http://www.owasp.org/index.php/ESAPI">http://www.owasp.org/index.php/ESAPI</a>.
 *
 * Copyright (c) 2007 - 2009 The OWASP Foundation
 * 
 * The ESAPI is published by OWASP under the BSD license. You should read and accept the
 * LICENSE before you use, modify, and/or redistribute this software.
 * 
 * @author <NAME> (<EMAIL>)
 * @created 2009
 * @since 1.6
 */
 
 

require_once __DIR__.'/../../src/ESAPI.php';
require_once __DIR__.'/../../src/reference/DefaultRandomizer.php';

class RandomizerTest extends PHPUnit_Framework_TestCase
{
	private $CHAR_ALPHANUMERICS = 'abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ01234567890';
	
	function setUp() 
	{
		global $ESAPI;
		
		if ( !isset($ESAPI)) 
		{
			$ESAPI = new ESAPI(__DIR__.'/../testresources/ESAPI.xml');
		}	
	}
	
	function tearDown()
	{
		
	}

    /**
     * Test of getRandomGUID method, of class org.owasp.esapi.Randomizer.
     * @throws EncryptionException
     */
    function testGetRandomGUID() {
        
        $instance = ESAPI::getRandomizer();
{'fraction_non_alphanumeric': 0.1314865392118611, 'fraction_numerical': 0.019508388607101055, 'mean_word_length': 3.3904109589041096, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, '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': '1191385', 'n_tokens_mistral': 947, 'n_tokens_neox': 839, 'n_words': 209}