Skip to content

Commit

Permalink
Add test case for aliased vendor namespaced plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Aug 10, 2014
1 parent 16a5b13 commit 907656f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/TestCase/I18n/I18nTest.php
@@ -1,7 +1,5 @@
<?php
/**
* I18nTest file
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand Down Expand Up @@ -137,12 +135,22 @@ public function testCreateCustomTranslationPackage() {
* @return void
*/
public function testPluginMesagesLoad() {
Plugin::load('TestPlugin');
Plugin::load([
'TestPlugin',
'TestPluginThree' => ['namespace' => 'Company\TestPluginThree']
]);

$translator = I18n::translator('test_plugin');
$this->assertEquals(
'Plural Rule 1 (from plugin)',
$translator->translate('Plural Rule 1')
);

$translator = I18n::translator('test_plugin_three');
$this->assertEquals(
'String 1 (from plugin three)',
$translator->translate('String 1')
);
}

/**
Expand Down
@@ -0,0 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: CakePHP Testsuite\n"
"POT-Creation-Date: 2008-05-15 02:51-0700\n"
"PO-Revision-Date: \n"
"Last-Translator: CakePHP I18N & I10N Team <i10n.cakephp@gmail.com>\n"
"Language-Team: CakePHP I18N & I10N Team <i10n.cakephp@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Poedit-Language: Two Forms of Plurals\n"
"X-Poedit-SourceCharset: utf-8\n"

msgid "String 1"
msgstr "String 1 (from plugin three)"

0 comments on commit 907656f

Please sign in to comment.