<commit_before><?php

/**
 * This file contains the CurlSetGetTest class.
 *
 * PHP Version 5.3
 *
 * @category   Libraries
 * @package    Core
 * @subpackage Tests
 * @author     M2Mobi <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 */

namespace Lunr\Libraries\Network;
use PHPUnit_Framework_TestCase;
use ReflectionClass;

/**
 * This class contains test methods for the getters and setters of the Curl class.
 *
 * @category   Libraries
 * @package    Core
 * @subpackage Tests
 * @author     <NAME> <<EMAIL>>
 * @covers     Lunr\Libraries\Network\Curl
 */
class CurlSetGetTest extends CurlTest
{

    /**
     * Test that the value of valid properties can be retrieved correctly.
     *
     * @dataProvider validPropertyProvider
     * @covers       Lunr\Libraries\Network\Curl::__get
     */
    public function testGetReturnsValuesForValidProperties($property, $value)
    {
        $this->assertEquals($value, $this->curl->$property);
    }

    /**
     * Test that the value of invalid properties is retrieved as NULL.
     *
     * @covers Lunr\Libraries\Network\Curl::__get
     */
    public function testGetReturnsNullForInvalidProperties()
    {
        $this->assertNull($this->curl->invalid_property);
    }

    /**
     * Test that an option that does not start with 'CURL' is not set.
     *
     * @dataProvider invalidOptionProvider
     * @covers       Lunr\Libraries\Network\Curl::set_option
     */
    public function testSetOptionDoesNotSetIfNameDoesNotStartWithCurl($option)
    {
        $property = $this->curl_reflection->getProperty('options');
        $property->setAccessible(TRUE);

        $old = $property->getValue($this->curl);

        $return = $this->curl->set_option($option, 'value');

        $this->assertEquals($old, $property->getValue($this->curl));
        $this->assertInstanceOf('Lunr\Libraries\Network\Curl', $return);
    }

    /**
     * Test that set_option() only works with valid curl constants.
     *
     * @covers Lunr\Libraries\Network\Curl::set_option
     */
    public function testSetOptionDoesNotSetIfCurlOptionDoesNotExist()
    {
        $property = $this->curl_reflection->getProperty('options');
        $property->setAccessible(TRUE);

        $old = $property->getValue($this->curl);
<commit_msg>tests: Fix coding style issues in curl unit tests<commit_after><?php

/**
 * This file contains the CurlSetGetTest class.
 *
 * PHP Version 5.3
 *
 * @category   Libraries
 * @package    Core
 * @subpackage Tests
 * @author     M2Mobi <<EMAIL>>
 * @author     <NAME> <<EMAIL>>
 */

namespace Lunr\Libraries\Network;
use PHPUnit_Framework_TestCase;
use ReflectionClass;

/**
 * This class contains test methods for the getters and setters of the Curl class.
 *
 * @category   Libraries
 * @package    Core
 * @subpackage Tests
 * @author     <NAME> <<EMAIL>>
 * @covers     Lunr\Libraries\Network\Curl
 */
class CurlSetGetTest extends CurlTest
{

    /**
     * Test that the value of valid properties can be retrieved correctly.
     *
     * @param String $property Property name
     * @param mixed  $value    Property value
     *
     * @dataProvider validPropertyProvider
     * @covers       Lunr\Libraries\Network\Curl::__get
     */
    public function testGetReturnsValuesForValidProperties($property, $value)
    {
        $this->assertEquals($value, $this->curl->$property);
    }

    /**
     * Test that the value of invalid properties is retrieved as NULL.
     *
     * @covers Lunr\Libraries\Network\Curl::__get
     */
    public function testGetReturnsNullForInvalidProperties()
    {
        $this->assertNull($this->curl->invalid_property);
    }

    /**
     * Test that an option that does not start with 'CURL' is not set.
     *
     * @param String $option Option name
     *
     * @dataProvider invalidOptionProvider
     * @covers       Lunr\Libraries\Network\Curl::set_option
     */
    public function testSetOptionDoesNotSetIfNameDoesNotStartWithCurl($option)
    {
        $property = $this->curl_reflection->getProperty('options');
        $property->setAccessible(TRUE);

        $old = $property->getValue($this->curl);

        $return = $this->curl->set_option($option, 'value');

        $this->assertEquals($old, $property->getValue($this->curl));
        $this->assertInstanceOf('Lunr\Libraries\Network\Curl', $return);
    }

    /**
     * Test that set_option() only works with valid curl constants.
     *
     * @covers Lunr\Libraries\Network\Curl::set_option
     */
    public function testSetOptionDoesNotSetIfCurlOptionDoesNotExist()
    {
        $property = $this->curl_reflection->getProperty('options');
        $property->setAccessible(TRUE);

        $old = $property->getValue($this->curl);

{'fraction_non_alphanumeric': 0.12208562950402713, 'fraction_numerical': 0.001271725307333616, 'mean_word_length': 2.9588926174496644, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7147902', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1387, 'n_words': 315}