<commit_before><?php
/* Sinogram Test cases generated on: 2015-02-24 09:10:47 : 1424769047*/
App::import('Model', 'Sinogram');

class SinogramTest extends CakeTestCase {
	public $fixtures = array('app.sinogram', 'app.sinogram_subglyph');

	function startTest($method) {
		$this->Sinogram = ClassRegistry::init('Sinogram');
	}

	function endTest($method) {
		unset($this->Sinogram);
		ClassRegistry::flush();
	}

	function assertGlyphs($expected, $result) {
		$result = array_map(function($rec) {
			return isset($rec['Sinogram']['glyph']) ? $rec['Sinogram']['glyph'] : null;
		}, $result);
		$this->assertEqual($expected, $result);
	}

	function testSearch_EmptySubglyphReturnsEmptyResults() {
		$excepted = array();
		$result = $this->Sinogram->search(array());
		$this->assertEqual($excepted, $result);
	}

	function testSearch_ReturnsOneGlyphs() {
		$excepted = array('蝴');
		$result = $this->Sinogram->search(array('月', '虫', '古'));
		$this->assertGlyphs($excepted, $result);
	}

	function testSearch_ReturnSeveralGlyphs() {
		$excepted = array('朗', '蓢', '蝴');
		$result = $this->Sinogram->search(array('月', '虫'));
		$this->assertGlyphs($excepted, $result);
	}

	function testSearch_ReturnsProvidedGlyphWhenOneGlyphPassed() {
		$excepted = array('蓢', '朗');
		$result = $this->Sinogram->search(array('朗'));
		$this->assertGlyphs($excepted, $result);
	}
}
<commit_msg>Fix Sinogram test testSearch_ReturnSeveralGlyphs()<commit_after><?php
/* Sinogram Test cases generated on: 2015-02-24 09:10:47 : 1424769047*/
App::import('Model', 'Sinogram');

class SinogramTest extends CakeTestCase {
	public $fixtures = array('app.sinogram', 'app.sinogram_subglyph');

	function startTest($method) {
		$this->Sinogram = ClassRegistry::init('Sinogram');
	}

	function endTest($method) {
		unset($this->Sinogram);
		ClassRegistry::flush();
	}

	function assertGlyphs($expected, $result) {
		$result = array_map(function($rec) {
			return isset($rec['Sinogram']['glyph']) ? $rec['Sinogram']['glyph'] : null;
		}, $result);
		$this->assertEqual($expected, $result);
	}

	function testSearch_EmptySubglyphReturnsEmptyResults() {
		$excepted = array();
		$result = $this->Sinogram->search(array());
		$this->assertEqual($excepted, $result);
	}

	function testSearch_ReturnsOneGlyphs() {
		$excepted = array('蝴');
		$result = $this->Sinogram->search(array('月', '虫', '古'));
		$this->assertGlyphs($excepted, $result);
	}

	function testSearch_ReturnSeveralGlyphs() {
		$excepted = array('朗', '蓢', '蝴');
		$result = $this->Sinogram->search(array('月', '虫'));
		$this->assertGlyphs($excepted, $result);
	}

	function testSearch_ReturnsProvidedGlyphWhenOneGlyphPassed() {
		$excepted = array('蓢', '朗');
		$result = $this->Sinogram->search(array('朗'));
		$this->assertGlyphs($excepted, $result);
	}
}

{'fraction_non_alphanumeric': 0.19675675675675675, 'fraction_numerical': 0.017297297297297298, 'mean_word_length': 6.1179487179487175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '7571523', 'n_tokens_mistral': 1103, 'n_tokens_neox': 974, 'n_words': 157}