<commit_before><commit_msg>Add Test<commit_after><?php
include_once __DIR__ . '/../../test-common.php';

class StreetTest extends \PHPUnit\Framework\TestCase{
	public function setUp() {
		parent::setUp();
	}
	public function test_addressToId(){
		$street = Nago\JpAddress\Street::getInstance();
		$this->assertSame(122270017, (int)$street->addressToId('千葉県浦安市舞浜１−１３'));
	}
	public function test_addressToName(){
		$street = Nago\JpAddress\Street::getInstance();
		$this->assertSame('舞浜', $street->addressToName('千葉県浦安市舞浜１−１３'));
	}
	
	public function test_nameToId(){
//		埼玉県さいたま市浦和区常盤4-3-15
		$street = Nago\JpAddress\Street::getInstance();
		$this->assertSame(111010023, (int)$street->nameToId(11, 11101, '二ツ宮'));
		$this->assertSame(111010010, (int)$street->nameToId(11, 11101, '三条町'));
	}
	public function test_idToName(){
		$street = Nago\JpAddress\Street::getInstance();
		$this->assertSame('二ツ宮', $street->idToName(11, 11101, 111010023));
	}
	public function test_removePrefAndCityAndStreetName(){
		$street = Nago\JpAddress\Street::getInstance();
		$this->assertSame('4-3-15', $street->removePrefAndCityAndStreetName('埼玉県さいたま市浦和区常盤4-3-15'));
	}
	public function test_prefIdAndCityIdAndAddressToId(){
		$street = Nago\JpAddress\Street::getInstance();
		$this->assertSame(111070012, (int)$street->prefIdAndCityIdAndAddressToId(11, 11107, '埼玉県さいたま市浦和区常盤4-3-15'));
	}
	public function test_streets(){
		$street = Nago\JpAddress\Street::getInstance();
		$array = $street->streets(13, 13101);
		$this->assertTrue(is_array($array));
	}
	public function test_streets_illegal(){
		$street = Nago\JpAddress\Street::getInstance();
		$array = $street->streets(13, 999999);
		$this->assertFalse($array);
	}
}
{'fraction_non_alphanumeric': 0.17792131532589547, 'fraction_numerical': 0.06459189665296536, 'mean_word_length': 6.539823008849558, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 21, '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': '1865192', 'n_tokens_mistral': 804, 'n_tokens_neox': 683, 'n_words': 84}