<commit_before><?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Db
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id$
 */


/**
 * @see Zend_Db_Select_TestCommon
 */
require_once 'Zend/Db/Select/TestCommon.php';


PHPUnit_Util_Filter::addFileToFilter(__FILE__);


/**
 * @category   Zend
 * @package    Zend_Db
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
abstract class Zend_Db_Table_Select_TestCommon extends Zend_Db_Select_TestCommon
{

    /**
     * @var array of Zend_Db_Table_Abstract
     */
    protected $_table = array();

    public function setUp()
    {
        parent::setUp();

        $this->_table['accounts']      = $this->_getTable('My_ZendDbTable_TableAccounts');
        $this->_table['bugs']          = $this->_getTable('My_ZendDbTable_TableBugs');
        $this->_table['bugs_products'] = $this->_getTable('My_ZendDbTable_TableBugsProducts');
        $this->_table['products']      = $this->_getTable('My_ZendDbTable_TableProducts');
    }

    protected function _getTable($tableClass, $options = array())
    {
        if (is_array($options) && !isset($options['db'])) {
            $options['db'] = $this->_db;
        }
        if (!class_exists($tableClass)) {
            $this->_useMyIncludePath();
            Zend_Loader::loadClass($tableClass);
            $this->_restoreIncludePath();
        }
        $table = new $tableClass($options);
        return $table;
    }

    protected function _useMyIncludePath()
    {<commit_msg>[TESTS] - Fixing tests/Zend/Db/Table/Select/TestCommon.php to restore include path if mangled<commit_after><?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Db
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id$
 */


/**
 * @see Zend_Db_Select_TestCommon
 */
require_once 'Zend/Db/Select/TestCommon.php';


PHPUnit_Util_Filter::addFileToFilter(__FILE__);


/**
 * @category   Zend
 * @package    Zend_Db
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
abstract class Zend_Db_Table_Select_TestCommon extends Zend_Db_Select_TestCommon
{

    protected $_runtimeIncludePath = null;
    
    /**
     * @var array of Zend_Db_Table_Abstract
     */
    protected $_table = array();

    public function setUp()
    {
        parent::setUp();

        $this->_table['accounts']      = $this->_getTable('My_ZendDbTable_TableAccounts');
        $this->_table['bugs']          = $this->_getTable('My_ZendDbTable_TableBugs');
        $this->_table['bugs_products'] = $this->_getTable('My_ZendDbTable_TableBugsProducts');
        $this->_table['products']      = $this->_getTable('My_ZendDbTable_TableProducts');
    }
    
    public function tearDown()
    {
        if ($this->_runtimeIncludePath) {
            $this->_restoreIncludePath();
        }
    }

    protected function _getTable($tableClass, $options = array())
    {
        if (is_array($options) && !isset($options['db'])) {
            $options['db'] = $this->_db;
        }
        if (!class_exists($tableClass)) {
            $this->_useMyIncludePath();
            Zend_Loader::loadClass($tableClass);
            $this->_restoreIncludePath();
        }
        $table = new $tableClass($options);
        return $table;
    }

    protected function _useMyIncludePath()
    {
{'fraction_non_alphanumeric': 0.12850467289719625, 'fraction_numerical': 0.006796941376380629, 'mean_word_length': 2.9738396624472574, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '7128371', 'n_tokens_mistral': 1489, 'n_tokens_neox': 1411, 'n_words': 341}