<commit_before><?php
/**
 * @copyright	Copyright 2010-2013, The Titon Project
 * @license		http://opensource.org/licenses/bsd-license.php
 * @link		http://titon.io
 */

namespace Titon\G11n;

use Titon\Test\TestCase;
use Titon\Test\Fixture\TranslatorFixture;
use \Exception;

/**
 * Test class for Titon\G11n\Translator.
 */
class TranslatorTest extends TestCase {

	/**
	 * Test that parsing a translation key returns the correct module, catalog and id.
	 */
	public function testParseKey() {
		$object = new TranslatorFixture();

		$this->assertEquals(['module', 'catalog', 'id'], $object->parseKey('module.catalog.id'));
		$this->assertEquals(['module', 'catalog', 'id.multi.part'], $object->parseKey('module.catalog.id.multi.part'));
		$this->assertEquals(['module', 'catalog', 'id-dashed'], $object->parseKey('module.catalog.id-dashed'));<commit_msg>Updated to use test stubs<commit_after><?php
/**
 * @copyright	Copyright 2010-2013, The Titon Project
 * @license		http://opensource.org/licenses/bsd-license.php
 * @link		http://titon.io
 */

namespace Titon\G11n;

use Titon\Test\TestCase;
use Titon\Test\Stub\TranslatorStub;
use \Exception;

/**
 * Test class for Titon\G11n\Translator.
 */
class TranslatorTest extends TestCase {

	/**
	 * Test that parsing a translation key returns the correct module, catalog and id.
	 */
	public function testParseKey() {
		$object = new TranslatorStub();

		$this->assertEquals(['module', 'catalog', 'id'], $object->parseKey('module.catalog.id'));
		$this->assertEquals(['module', 'catalog', 'id.multi.part'], $object->parseKey('module.catalog.id.multi.part'));
		$this->assertEquals(['module', 'catalog', 'id-dashed'], $object->parseKey('module.catalog.id-dashed'));
{'fraction_non_alphanumeric': 0.17629889083479275, 'fraction_numerical': 0.014010507880910683, 'mean_word_length': 4.849829351535837, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '6701650', 'n_tokens_mistral': 579, 'n_tokens_neox': 537, 'n_words': 119}