<commit_before><?php

namespace GeoFixer\tests;
use GeoFixer\GeoFixerFacade;

/**
 * Class FindFiasIdTest
 *
 * @group fias
 * @package GeoFixer\tests
 */
class FindKladrIdTest extends \PHPUnit_Framework_TestCase
{
    public function __construct($name = NULL, array $data = array(), $dataName = '')
    {
        parent::__construct($name, $data, $dataName);

        $this->facade = new GeoFixerFacade($fias = true);
    }

    public function testFindKladrRegion()
    {
        $region = 'Ленинрадская область';

        $this->assertEquals(4700000000000, $this->facade->findKladrRegion($region));
    }

    public function testFindStrictKladrRegion()
    {
        $region = 'Ленинрадская область';

        $this->assertEquals(4700000000000, $this->facade->findKladrRegion($region, 2, true));
    }

    public function testRegionError()
    {
        $region = 'Банановая респубика';

        $this->assertFalse($this->facade->findKladrRegion($region, false, true));
    }

    public function testFindKladrSettlement()
    {
        $city = 'Блоговщнск'; // Благовещенск
        $region_code = 2800000000000;

        $this->assertEquals('2800000100000', $this->facade->findKladrSettlement($city, $region_code));
    }

    public function testFindStrictKladrSettlement()
    {
        $city = 'Блоговщнск'; // Благовещенск
        $region_code = 2800000000000;

        $this->assertEquals('2800000100000', $this->facade->findKladrSettlement($city, $region_code, 2));
    }

    public function testSettlementError()
    {
        $city = 'Эльдорадо';
        $region = 2800000000000;

        $this->assertFalse($this->facade->findKladrSettlement($city, $region, false, true));
    }

    public function testFindRegionAndCity()
    {
        $region = 'Чеченская республика';
        $city = 'Грозный';

        $this->assertEquals('2000000100000', $this->facade->findKladrSettlement($city, $this->facade->findKladrRegion($region)));
    }

}<commit_msg>add kladr street tests<commit_after><?php

namespace GeoFixer\tests;
use GeoFixer\GeoFixerFacade;

/**
 * Class FindFiasIdTest
 *
 * @group fias
 * @package GeoFixer\tests
 */
class FindKladrIdTest extends \PHPUnit_Framework_TestCase
{
    public function __construct($name = NULL, array $data = array(), $dataName = '')
    {
        parent::__construct($name, $data, $dataName);

        $this->facade = new GeoFixerFacade($fias = true);
    }

    public function testFindKladrRegion()
    {
        $region = 'Ленинрадская область';

        $this->assertEquals(4700000000000, $this->facade->findKladrRegion($region));
    }

    public function testFindStrictKladrRegion()
    {
        $region = 'Ленинрадская область';

        $this->assertEquals(4700000000000, $this->facade->findKladrRegion($region, 2, true));
    }

    public function testRegionError()
    {
        $region = 'Банановая респубика';

        $this->assertFalse($this->facade->findKladrRegion($region, false, true));
    }

    public function testFindKladrSettlement()
    {
        $city = 'Блоговщнск'; // Благовещенск
        $region_code = 2800000000000;

        $this->assertEquals('2800000100000', $this->facade->findKladrSettlement($city, $region_code));
    }

    public function testFindStrictKladrSettlement()
    {
        $city = 'Блоговщнск'; // Благовещенск
        $region_code = 2800000000000;

        $this->assertEquals('2800000100000', $this->facade->findKladrSettlement($city, $region_code, 2));
    }

    public function testSettlementError()
    {
        $city = 'Эльдорадо';
        $region = 2800000000000;

        $this->assertFalse($this->facade->findKladrSettlement($city, $region, false, true));
    }

    public function testFindRegionAndCity()
    {
        $region = 'Чеченская республика';
        $city = 'Грозный';

        $this->assertEquals('2000000100000', $this->facade->findKladrSettlement($city, $this->facade->findKladrRegion($region)));
    }

    public function testFindStreet()
    {
        $city_code = '2800000100000';
        $street = 'Амурская';

        $this->assertEquals('28000001000000200', $this->facade->findKladrStreet($street, $city_code));
    }

    public function testFindStrictStreet()
    {
        $city_code = '2800000100000';
        $street = 'Амурская';

        $this->assertEquals('28000001000000200', $this->facade->findKladrStreet($street, $city_code, 2));
    }

    public function testStreetError()
    {
        $city_code = '2800000100000';
        $street = 'Несуществующая';

        $this->assertFalse($this->facade->findKladrStreet($street, $city_code, false, $strict_search = true));
    }

}
{'fraction_non_alphanumeric': 0.13884690131721011, 'fraction_numerical': 0.06175771971496437, 'mean_word_length': 3.2612695492180315, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 10, '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': '7557274', 'n_tokens_mistral': 1778, 'n_tokens_neox': 1548, 'n_words': 240}