<commit_before><?php
/**
 * ShellTest file
 *
 * Test Case for Shell
 *
 * PHP 5
 *
 * CakePHP :  Rapid Development Framework (http://cakephp.org)
 * Copyright 2006-2010, Cake Software Foundation, Inc.
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2006-2010, Cake Software Foundation, Inc.
 * @link          http://cakephp.org CakePHP Project
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 * @since         CakePHP v 1.2.0.7726
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
App::import('Core', 'Folder');
App::import('Shell', 'Shell', false);

require_once CAKE . 'console' .  DS . 'shell_dispatcher.php';

/**
 * TestShell class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class TestShell extends Shell {

/**
 * name property
 *
 * @var name
 * @access public
 */
	public $name = 'TestShell';

/**
 * stopped property
 *
 * @var integer
 * @access public
 */
	public $stopped;

/**
 * stop method
 *
 * @param integer $status
 * @return void
 */
	protected function _stop($status = 0) {
		$this->stopped = $status;
	}

	public function do_something() {
		
	}
	
	public function _secret() {
		
	}
	
	protected function no_access() {
		
	}
	
	public function mergeVars($properties, $class, $normalize = true) {
		return $this->_mergeVars($properties, $class, $normalize);
	}
}

/**
 * Class for testing merging vars
 *
 * @package cake.tests.cases.console
 */
class TestMergeShell extends Shell {
	var $tasks = array('DbConfig', 'Fixture');
	var $uses = array('Comment');
}

/**
 * TestAppleTask class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class TestAppleTask extends Shell {
}

/**
 * TestBananaTask class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class TestBananaTask extends Shell {
}

/**
 * ShellTest class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class ShellTest extends CakeTestCase {

/**
 * Fixtures used in this test case
 *
 * @var array
 * @access public
 */
	public $fixtures = array(
		'core.post', 'core.comment', 'core.article', 'core.user',
		'core.tag', 'core.articles_tag', 'core.attachment'
	);

/**
 * setUp method
 *
 * @return void
 */
	public function setUp() {
		parent::setUp();

		$output = $this->getMock('ConsoleOutput', array(), array(), '', false);
		$error = $this->getMock('ConsoleOutput', array(), array(), '', false);
		$in = $this->getMock('ConsoleInput', array(), array(), '', false);
		$this->Shell = new TestShell($output, $error, $in);
	}

/**
 * testConstruct method
 *
 * @return void
 */
	public function testConstruct() {
		$this->assertEqual($this->Shell->name, 'TestShell');
		$this->assertType('ConsoleInput', $this->Shell->stdin);
		$this->assertType('ConsoleOutput', $this->Shell->stdout);
		$this->assertType('ConsoleOutput', $this->Shell->stderr);
	}

/**
 * test merging vars<commit_msg>Removing collisions that prevent TestTask from being loaded.<commit_after><?php
/**
 * ShellTest file
 *
 * Test Case for Shell
 *
 * PHP 5
 *
 * CakePHP :  Rapid Development Framework (http://cakephp.org)
 * Copyright 2006-2010, Cake Software Foundation, Inc.
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2006-2010, Cake Software Foundation, Inc.
 * @link          http://cakephp.org CakePHP Project
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 * @since         CakePHP v 1.2.0.7726
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
App::import('Core', 'Folder');
App::import('Shell', 'Shell', false);

require_once CAKE . 'console' .  DS . 'shell_dispatcher.php';

/**
 * ShellTestShell class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class ShellTestShell extends Shell {

/**
 * name property
 *
 * @var name
 * @access public
 */
	public $name = 'ShellTestShell';

/**
 * stopped property
 *
 * @var integer
 * @access public
 */
	public $stopped;

/**
 * stop method
 *
 * @param integer $status
 * @return void
 */
	protected function _stop($status = 0) {
		$this->stopped = $status;
	}

	public function do_something() {
		
	}
	
	public function _secret() {
		
	}
	
	protected function no_access() {
		
	}
	
	public function mergeVars($properties, $class, $normalize = true) {
		return $this->_mergeVars($properties, $class, $normalize);
	}
}

/**
 * Class for testing merging vars
 *
 * @package cake.tests.cases.console
 */
class TestMergeShell extends Shell {
	var $tasks = array('DbConfig', 'Fixture');
	var $uses = array('Comment');
}

/**
 * TestAppleTask class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class TestAppleTask extends Shell {
}

/**
 * TestBananaTask class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class TestBananaTask extends Shell {
}

/**
 * ShellTest class
 *
 * @package       cake
 * @subpackage    cake.tests.cases.console.libs
 */
class ShellTest extends CakeTestCase {

/**
 * Fixtures used in this test case
 *
 * @var array
 * @access public
 */
	public $fixtures = array(
		'core.post', 'core.comment', 'core.article', 'core.user',
		'core.tag', 'core.articles_tag', 'core.attachment'
	);

/**
 * setUp method
 *
 * @return void
 */
	public function setUp() {
		parent::setUp();

		$output = $this->getMock('ConsoleOutput', array(), array(), '', false);
		$error = $this->getMock('ConsoleOutput', array(), array(), '', false);
		$in = $this->getMock('ConsoleInput', array(), array(), '', false);
		$this->Shell = new ShellTestShell($output, $error, $in);
	}

/**
 * testConstruct method
 *
 * @return void
 */
	public function testConstruct() {
		$this->assertEqual($this->Shell->name, 'ShellTestShell');
		$this->assertType('ConsoleInput', $this->Shell->stdin);
		$this->assertType('ConsoleOutput', $this->Shell->stdout);
		$this->assertType('ConsoleOutput', $this->Shell->stderr);
	}

/**
 * test merging vars
{'fraction_non_alphanumeric': 0.16000649772579598, 'fraction_numerical': 0.008122157244964262, 'mean_word_length': 3.4519161243673175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '5316755', 'n_tokens_mistral': 2048, 'n_tokens_neox': 1918, 'n_words': 486}