<commit_before><?php

/**
 * This file contains the SQLite3ConnectionEscapeTest class.
 *
 * PHP Version 5.4
 *
 * @category   SQLite
 * @package    Gravity
 * @subpackage Database
 * @author     <NAME> <<EMAIL>>
 * @copyright  2013-2014, M2Mobi BV, Amsterdam, The Netherlands
 * @license    http://lunr.nl/LICENSE MIT License
 */

namespace Lunr\Gravity\Database\SQLite3\Tests;

use Lunr\Gravity\Database\SQLite3\SQLite3Connection;

/**
 * This class contains string escape unit tests for SQLite3Connection.
 *
 * @category   SQLite
 * @package    Gravity
 * @subpackage Database
 * @author     <NAME> <<EMAIL>>
 * @covers     Lunr\Gravity\Database\SQLite3\SQLite3Connection
 */
class SQLite3ConnectionEscapeTest extends SQLite3ConnectionTest
{

    /**
     * Test that escape_string() properly escapes the given string.
     *
     * @param String $string       String to escape
     * @param String $part_escaped Partially escaped string (as returned by escapeString)
     * @param String $escaped      Expected escaped string
     *
     * @dataProvider escapeStringProvider
     * @covers       Lunr\Gravity\Database\SQLite3\SQLite3Connection::escape_string
     */
    public function testEscapeString($string, $part_escaped, $escaped)
    {
        $this->sqlite3->staticExpects($this->once())
                      ->method('escapeString')
                      ->will($this->returnValue($escaped));

        $value = $this->class->escape_string($string);

        $this->assertEquals($escaped, $value);
    }

}

?><commit_msg>Gravity: staticExpects is deprecated in new phpunit versions<commit_after><?php

/**
 * This file contains the SQLite3ConnectionEscapeTest class.
 *
 * PHP Version 5.4
 *
 * @category   SQLite
 * @package    Gravity
 * @subpackage Database
 * @author     <NAME> <<EMAIL>>
 * @copyright  2013-2014, M2Mobi BV, Amsterdam, The Netherlands
 * @license    http://lunr.nl/LICENSE MIT License
 */

namespace Lunr\Gravity\Database\SQLite3\Tests;

use Lunr\Gravity\Database\SQLite3\SQLite3Connection;

/**
 * This class contains string escape unit tests for SQLite3Connection.
 *
 * @category   SQLite
 * @package    Gravity
 * @subpackage Database
 * @author     <NAME> <<EMAIL>>
 * @covers     Lunr\Gravity\Database\SQLite3\SQLite3Connection
 */
class SQLite3ConnectionEscapeTest extends SQLite3ConnectionTest
{

    /**
     * Test that escape_string() properly escapes the given string.
     *
     * @param String $string       String to escape
     * @param String $part_escaped Partially escaped string (as returned by escapeString)
     * @param String $escaped      Expected escaped string
     *
     * @dataProvider escapeStringProvider
     * @covers       Lunr\Gravity\Database\SQLite3\SQLite3Connection::escape_string
     */
    public function testEscapeString($string, $part_escaped, $escaped)
    {
        $method = array(get_class($this->sqlite3), 'escapeString');

        $this->mock_method($method, 'return "' . $escaped . '";');

        $value = $this->class->escape_string($string);

        $this->assertEquals($escaped, $value);

        $this->unmock_method($method);
    }

}

?>
{'fraction_non_alphanumeric': 0.11475932419509086, 'fraction_numerical': 0.014663691424928276, 'mean_word_length': 3.184, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 32, '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': '4941620', 'n_tokens_mistral': 976, 'n_tokens_neox': 929, 'n_words': 219}