<commit_before><?php

/**
 * Mol_Test_Assertions_HttpResponse
 *
 * @category PHP
 * @package Mol_Test
 * @author <NAME> <<EMAIL>>
 * @copyright 2011-2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/MolComponents
 * @since 02.07.2011
 */

/**
 * Encapsulates assertions regarding the response object.
 *
 * Test cases may return an instance of Mol_Test_Assertions_HttpResponse to
 * support speaking method calls:
 *
 *     // assertResponse() returns an instance of Mol_Test_Assertions_Response
 *     $this->assertResponse()->contains('Hello!');
 *
 * @category PHP
 * @package Mol_Test
 * @author <NAME> <<EMAIL>>
 * @copyright 2011-2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/MolComponents
 * @since 02.07.2011
 */
class Mol_Test_Assertions_HttpResponse
{
    
    /**
     * The tested response.
     *
     * @var Zend_Controller_Response_Http
     */
    protected $response = null;

    /**
     * Creates the assertion tester for the given response.
     *
     * @param Zend_Controller_Response_Http $response
     */
    public function __construct($response)
    {
        PHPUnit_Framework_Assert::assertType('Zend_Controller_Response_Http', $response);
        $this->response = $response;
    }

    /**
     * Asserts that the response returns the provided HTTP code.
     *
     * @param integer $expected The HTTP code.
     */
    public function hasCode($expected)<commit_msg>fixed type test to be compatible to newer versions of PHPUnit<commit_after><?php

/**
 * Mol_Test_Assertions_HttpResponse
 *
 * @category PHP
 * @package Mol_Test
 * @author <NAME> <<EMAIL>>
 * @copyright 2011-2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/MolComponents
 * @since 02.07.2011
 */

/**
 * Encapsulates assertions regarding the response object.
 *
 * Test cases may return an instance of Mol_Test_Assertions_HttpResponse to
 * support speaking method calls:
 *
 *     // assertResponse() returns an instance of Mol_Test_Assertions_Response
 *     $this->assertResponse()->contains('Hello!');
 *
 * @category PHP
 * @package Mol_Test
 * @author <NAME> <<EMAIL>>
 * @copyright 2011-2012 <NAME>
 * @license http://www.opensource.org/licenses/BSD-3-Clause BSD License
 * @link https://github.com/Matthimatiker/MolComponents
 * @since 02.07.2011
 */
class Mol_Test_Assertions_HttpResponse
{
    
    /**
     * The tested response.
     *
     * @var Zend_Controller_Response_Http
     */
    protected $response = null;

    /**
     * Creates the assertion tester for the given response.
     *
     * @param Zend_Controller_Response_Http $response
     */
    public function __construct($response)
    {
        PHPUnit_Framework_Assert::assertInstanceOf('Zend_Controller_Response_Http', $response);
        $this->response = $response;
    }

    /**
     * Asserts that the response returns the provided HTTP code.
     *
     * @param integer $expected The HTTP code.
     */
    public function hasCode($expected)
{'fraction_non_alphanumeric': 0.11630847029077118, 'fraction_numerical': 0.021491782553729456, 'mean_word_length': 3.3178717598908594, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, 'https://': 4, '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': '1873373', 'n_tokens_mistral': 985, 'n_tokens_neox': 923, 'n_words': 229}