<commit_before><?php
/**
 * @package  Framework/Test
 * @author  <NAME> (<EMAIL>)
 * @copyright  Copyright 2011 <NAME> (<a href="http://www.mitmaro.ca">www.mitmaro.ca</a>)
 * @license  <a href="http://www.opensource.org/licenses/mit-license.php">The MIT License</a>
 */

require_once 'Framework/Request.php';

use
	\Framework\Request
;

class Request_Test extends PHPUnit_Framework_TestCase {
	
	/**
	 * @covers \Framework\Request::addUrlPatterns
	 * @covers \Framework\Request::getUrlPatternMap
	 */
	public function testAddUrlPatterns_valid() {
		$request = new Request();
		$request->addUrlPatterns(array('abc' => 'def.ghi'));
		
		$this->assertEquals(
			array('abc' => array('class' => 'def', 'method' => 'ghi')),
			$request->getUrlPatternMap()
		);
		
		$request->addUrlPatterns(array(
			'def' => 'abc2.def',
			'cde' => 'abc.def',
			'abc' => 'abc.def'
		));
		
		$this->assertEquals(
			array(
				'def' => array('class' => 'abc2', 'method' => 'def'),<commit_msg>Added missing require for Exception class<commit_after><?php
/**
 * @package  Framework\Test
 * @author  <NAME> (<EMAIL>)
 * @copyright  Copyright 2011 <NAME> (<a href="http://www.mitmaro.ca">www.mitmaro.ca</a>)
 * @license  <a href="http://www.opensource.org/licenses/mit-license.php">The MIT License</a>
 */

require_once 'Framework/Request.php';
require_once 'Framework/Request/Exception.php';

use
	\Framework\Request
;

class Request_Test extends PHPUnit_Framework_TestCase {
	
	/**
	 * @covers \Framework\Request::addUrlPatterns
	 * @covers \Framework\Request::getUrlPatternMap
	 */
	public function testAddUrlPatterns_valid() {
		$request = new Request();
		$request->addUrlPatterns(array('abc' => 'def.ghi'));
		
		$this->assertEquals(
			array('abc' => array('class' => 'def', 'method' => 'ghi')),
			$request->getUrlPatternMap()
		);
		
		$request->addUrlPatterns(array(
			'def' => 'abc2.def',
			'cde' => 'abc.def',
			'abc' => 'abc.def'
		));
		
		$this->assertEquals(
			array(
				'def' => array('class' => 'abc2', 'method' => 'def'),
{'fraction_non_alphanumeric': 0.19980217606330367, 'fraction_numerical': 0.005934718100890208, 'mean_word_length': 4.200514138817481, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '1761730', 'n_tokens_mistral': 781, 'n_tokens_neox': 696, 'n_words': 122}