<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_Session
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id$
 */


/**
 * PHPUnit test case
 */
require_once 'PHPUnit/Framework/TestCase.php';


/**
 * @see Zend_Session
 */
require_once 'Zend/Session.php';


/**
 * Black box testing for Zend_Session
 *
 * @category   Zend
 * @package    Zend_Session
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @see        http://en.wikipedia.org/wiki/Black_box_testing
 */
class Zend_SessionTest extends PHPUnit_Framework_TestCase
{
    /**
     * Helper script invoked via exec()
     *
     * @var string
     */
    protected $_script = null;

    /**
     * Storage for session.save_path, so that unit tests may change the value without side effect
     *
     * @var string
     */
    protected $_savePath;

    /**
     * Initializes instance data
     *
     * @return void
     */
    public function __construct()
    {
        $this->_script   = 'php ' . escapeshellarg(
            dirname(__FILE__) . DIRECTORY_SEPARATOR . 'SessionTestHelper.php'
            );

        $this->_savePath = ini_get('session.save_path');
    }

    /**
     * Cleanup operations after each test method is run
     *
     * @return void
     */
    public function tearDown()
    {
        ini_set('session.save_path', $this->_savePath);

        $this->assertSame(
            E_ALL | E_STRICT,
            error_reporting( E_ALL | E_STRICT ),
            'A test altered error_reporting to something other than E_ALL | E_STRICT'
            );<commit_msg>Zend_Session: * Fix for the problem coused by different environment used by test helper script. Closes [ZF-3766].<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_Session
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id$
 */


/**
 * PHPUnit test case
 */
require_once 'PHPUnit/Framework/TestCase.php';


/**
 * @see Zend_Session
 */
require_once 'Zend/Session.php';


/**
 * Black box testing for Zend_Session
 *
 * @category   Zend
 * @package    Zend_Session
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @see        http://en.wikipedia.org/wiki/Black_box_testing
 */
class Zend_SessionTest extends PHPUnit_Framework_TestCase
{
    /**
     * Helper script invoked via exec()
     *
     * @var string
     */
    protected $_script = null;

    /**
     * Storage for session.save_path, so that unit tests may change the value without side effect
     *
     * @var string
     */
    protected $_savePath;

    /**
     * Initializes instance data
     *
     * @return void
     */
    public function __construct()
    {
        $this->_script = 'php -c ' . php_ini_loaded_file() . ' '
            . escapeshellarg(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'SessionTestHelper.php');

        $this->_savePath = ini_get('session.save_path');
    }

    /**
     * Cleanup operations after each test method is run
     *
     * @return void
     */
    public function tearDown()
    {
        ini_set('session.save_path', $this->_savePath);

        $this->assertSame(
            E_ALL | E_STRICT,
            error_reporting( E_ALL | E_STRICT ),
            'A test altered error_reporting to something other than E_ALL | E_STRICT'
            );
{'fraction_non_alphanumeric': 0.1079822146940504, 'fraction_numerical': 0.007622273978403557, 'mean_word_length': 2.5174981384959048, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '5982614', 'n_tokens_mistral': 1472, 'n_tokens_neox': 1387, 'n_words': 426}