<commit_before><?php

class CM_FormField_LocationTest extends CMTest_TestCase {

	public function testSetValueByRequest() {
		$request = new CM_Request_Get('/fuu/');
		$location = CMTest_TH::createLocation();
		$locationCity = $location->get(CM_Model_Location::LEVEL_CITY);

		$field = $this->getMock('CM_FormField_Location', array('_getRequestLocationByRequest'), array('foo'));
		$field->expects($this->any())->method('_getRequestLocationByRequest')->will($this->returnValue(null));
		/** @var CM_FormField_Location $field */
		$field->setValueByRequest($request);
		$this->assertSame(null, $field->getValue());

		$field = $this->getMock('CM_FormField_Location', array('_getRequestLocationByRequest'), array('foo', CM_Model_Location::LEVEL_CITY,
			CM_Model_Location::LEVEL_CITY));
		$field->expects($this->any())->method('_getRequestLocationByRequest')->will($this->returnValue($location->get(CM_Model_Location::LEVEL_COUNTRY)));
		$field->setValueByRequest($request);
		$this->assertSame(null, $field->getValue());

		$field = $this->getMock('CM_FormField_Location', array('_getRequestLocationByRequest'), array('foo', CM_Model_Location::LEVEL_CITY,<commit_msg>Using assertNull<commit_after><?php

class CM_FormField_LocationTest extends CMTest_TestCase {

	public function testSetValueByRequest() {
		$request = new CM_Request_Get('/fuu/');
		$location = CMTest_TH::createLocation();
		$locationCity = $location->get(CM_Model_Location::LEVEL_CITY);

		$field = $this->getMock('CM_FormField_Location', array('_getRequestLocationByRequest'), array('foo'));
		$field->expects($this->any())->method('_getRequestLocationByRequest')->will($this->returnValue(null));
		/** @var CM_FormField_Location $field */
		$field->setValueByRequest($request);
		$this->assertNull($field->getValue());

		$field = $this->getMock('CM_FormField_Location', array('_getRequestLocationByRequest'), array('foo', CM_Model_Location::LEVEL_CITY,
			CM_Model_Location::LEVEL_CITY));
		$field->expects($this->any())->method('_getRequestLocationByRequest')->will($this->returnValue($location->get(CM_Model_Location::LEVEL_COUNTRY)));
		$field->setValueByRequest($request);
		$this->assertNull($field->getValue());

		$field = $this->getMock('CM_FormField_Location', array('_getRequestLocationByRequest'), array('foo', CM_Model_Location::LEVEL_CITY,
{'fraction_non_alphanumeric': 0.17649591046061128, 'fraction_numerical': 0.0, 'mean_word_length': 9.563636363636364, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '2640240', 'n_tokens_mistral': 749, 'n_tokens_neox': 716, 'n_words': 80}