<commit_before><?php
/**
 * Lithium: the most rad php framework
 *
 * @copyright     Copyright 2010, Union of RAD (http://union-of-rad.org)
 * @license       http://opensource.org/licenses/bsd-license.php The BSD License
 */

namespace lithium\test;

use \Exception;
use \lithium\core\Libraries;
use \lithium\util\Inflector;

/**
 * Report object for running group tests holding results
 *
 * @package default
 */
class Report extends \lithium\core\Object {

	/**
	 * Contains an instance of `lithium\test\Group`, which contains all unit tests to be executed
	 * this test run.
	 *
	 * @var object
	 */
	public $group = null;

	/**
	 * An array of fully-namespaced class names representing the filters to be applied to this test
	 * group.
	 *
	 * @var array
	 */
	public $filters = array();

	/**
	 * Title of the group being run
	 *
	 * @var string
	 */
	public $title = null;

	/**
	 * group and filter results
	 *
	 * @var array
	 */
	public $results = array('group' => array(), 'filters' => array());

	/**
	 * start and end timers
	 *
	 * @var array
	 */
	public $timer = array('start' => null, 'end' => null);

	/**
	 * Construct Report Object
	 *
	 * @param array $config Options array for the test run. Valid options are:
	 *        - 'group': The test group with items to be run.
	 *		  - 'filters': An array of filters that the test output should be run through.
	 */
	public function __construct(array $config = array()) {
		$defaults = array(
			'title' => null,
			'group' => null,
			'filters' => array(),
			'format' => 'txt',
			'reporter' => 'txt'
		);
		parent::__construct((array) $config + $defaults);
	}

	/**
	 * undocumented function
	 *
	 * @return void
	 */
	protected function _init() {
		$this->group = $this->_config['group'];
		$this->filters = $this->_config['filters'];
		$this->title = $this->_config['title'] ?: $this->_config['title'];
	}

	/**
	 * undocumented function
	 *
	 * @return void
	 */
	public function run() {
		$tests = $this->group->tests();
		$filters = array();

		foreach ($this->filters as $filter => $options) {
			$filter = ucwords($filter);
			if (!$class = Libraries::locate('test.filter', $filter)) {<commit_msg>Fixed bug running tests from browser.<commit_after><?php
/**
 * Lithium: the most rad php framework
 *
 * @copyright     Copyright 2010, Union of RAD (http://union-of-rad.org)
 * @license       http://opensource.org/licenses/bsd-license.php The BSD License
 */

namespace lithium\test;

use \Exception;
use \lithium\core\Libraries;
use \lithium\util\Inflector;

/**
 * Report object for running group tests holding results
 *
 * @package default
 */
class Report extends \lithium\core\Object {

	/**
	 * Contains an instance of `lithium\test\Group`, which contains all unit tests to be executed
	 * this test run.
	 *
	 * @var object
	 */
	public $group = null;

	/**
	 * An array of fully-namespaced class names representing the filters to be applied to this test
	 * group.
	 *
	 * @var array
	 */
	public $filters = array();

	/**
	 * Title of the group being run
	 *
	 * @var string
	 */
	public $title = null;

	/**
	 * group and filter results
	 *
	 * @var array
	 */
	public $results = array('group' => array(), 'filters' => array());

	/**
	 * start and end timers
	 *
	 * @var array
	 */
	public $timer = array('start' => null, 'end' => null);

	/**
	 * Construct Report Object
	 *
	 * @param array $config Options array for the test run. Valid options are:
	 *        - 'group': The test group with items to be run.
	 *		  - 'filters': An array of filters that the test output should be run through.
	 */
	public function __construct(array $config = array()) {
		$defaults = array(
			'title' => null,
			'group' => null,
			'filters' => array(),
			'format' => 'txt',
			'reporter' => 'txt'
		);
		parent::__construct((array) $config + $defaults);
	}

	/**
	 * undocumented function
	 *
	 * @return void
	 */
	protected function _init() {
		$this->group = $this->_config['group'];
		$this->filters = $this->_config['filters'];
		$this->title = $this->_config['title'] ?: $this->_config['title'];
	}

	/**
	 * undocumented function
	 *
	 * @return void
	 */
	public function run() {
		$tests = $this->group->tests();
		$filters = array();

		foreach ($this->filters as $filter => $options) {
			if (!strpos($filter, "\\")) {
				$filter = ucwords($filter);
			}
			if (!$class = Libraries::locate('test.filter', $filter)) {
{'fraction_non_alphanumeric': 0.16216216216216217, 'fraction_numerical': 0.0018169429934135816, 'mean_word_length': 3.0292772186642267, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, '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': '4605444', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1334, 'n_words': 429}