<commit_before><?php
/**
 * CacheHelperTest file
 *
 * PHP 5
 *
 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
 * @package       cake.tests.cases.libs.view.helpers
 * @since         CakePHP(tm) v 1.2.0.4206
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

App::uses('Controller', 'Controller');
App::uses('Model', 'Model');
App::uses('View', 'View');
App::uses('CacheHelper', 'View/Helper');

/**
 * CacheTestController class
 *
 * @package       cake.tests.cases.libs.view.helpers
 */
class CacheTestController extends Controller {

/**
 * helpers property
 *
 * @var array
 * @access public
 */
	public $helpers = array('Html', 'Cache');

/**
 * cache_parsing method
 *
 * @access public
 * @return void
 */
	function cache_parsing() {
		$this->viewPath = 'posts';
		$this->layout = 'cache_layout';
		$this->set('variable', 'variableValue');
		$this->set('superman', 'clark kent');
		$this->set('batman', 'bruce wayne');
		$this->set('spiderman', 'peter parker');
	}
}

/**
 * CacheHelperTest class
 *
 * @package       cake.tests.cases.libs.view.helpers
 */
class CacheHelperTest extends CakeTestCase {

/**
 * Checks if TMP/views is writable, and skips the case if it is not.
 *
 * @return void
 */
	function skip() {
		$this->skipUnless(is_writable(TMP . 'cache' . DS . 'views' . DS), 'TMP/views is not writable %s');
	}
/**
 * setUp method
 *
 * @access public
 * @return void
 */
	function setUp() {
		parent::setUp();
		$request = new CakeRequest();
		$this->Controller = new CacheTestController($request);
		$View = new View($this->Controller);
		$this->Cache = new CacheHelper($View);
		Configure::write('Cache.check', true);
		Configure::write('Cache.disable', false);
		App::build(array(
			'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
		), true);
	}

/**
 * tearDown method
 *
 * @access public<commit_msg>Fixing problem in cache helper test<commit_after><?php
/**
 * CacheHelperTest file
 *
 * PHP 5
 *
 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice
 *
 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests
 * @package       cake.tests.cases.libs.view.helpers
 * @since         CakePHP(tm) v 1.2.0.4206
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

App::uses('Controller', 'Controller');
App::uses('Model', 'Model');
App::uses('View', 'View');
App::uses('CacheHelper', 'View/Helper');

/**
 * CacheTestController class
 *
 * @package       cake.tests.cases.libs.view.helpers
 */
class CacheTestController extends Controller {

/**
 * helpers property
 *
 * @var array
 * @access public
 */
	public $helpers = array('Html', 'Cache');

/**
 * cache_parsing method
 *
 * @access public
 * @return void
 */
	function cache_parsing() {
		$this->viewPath = 'posts';
		$this->layout = 'cache_layout';
		$this->set('variable', 'variableValue');
		$this->set('superman', '<NAME>');
		$this->set('batman', '<NAME>');
		$this->set('spiderman', '<NAME>');
	}
}

/**
 * CacheHelperTest class
 *
 * @package       cake.tests.cases.libs.view.helpers
 */
class CacheHelperTest extends CakeTestCase {

/**
 * Checks if TMP/views is writable, and skips the case if it is not.
 *
 * @return void
 */
	function skip() {
		$this->skipUnless(is_writable(TMP . 'cache' . DS . 'views' . DS), 'TMP/views is not writable %s');
	}
/**
 * setUp method
 *
 * @access public
 * @return void
 */
	function setUp() {
		parent::setUp();
		$request = new CakeRequest();
		$this->Controller = new CacheTestController($request);
		$View = new View($this->Controller);
		$this->Cache = new CacheHelper($View);
		Configure::write('Cache.check', true);
		Configure::write('Cache.disable', false);
		App::build(array(
			'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS)
		), true);
	}

/**
 * tearDown method
 *
 * @access public
{'fraction_non_alphanumeric': 0.17577092511013215, 'fraction_numerical': 0.014096916299559472, 'mean_word_length': 3.667009249743063, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '5391201', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1488, 'n_words': 349}