Backport unit tests from branch 2.0 (tests for strings concatenated with '.')

This commit is contained in:
zoydsan 2011-09-08 17:54:13 +03:00 committed by mark_story
parent 200c85c7c4
commit cd14874b59
2 changed files with 26 additions and 2 deletions

View file

@ -139,6 +139,18 @@ class ExtractTaskTest extends CakeTestCase {
$pattern .= 'msgid "Editing this Page"\nmsgstr ""/';
$this->assertPattern($pattern, $result);
$pattern = '/\#: (\\\\|\/)extract\.ctp:17\nmsgid "';
$pattern .= 'Hot features!';
$pattern .= '\\\n - No Configuration: Set-up the database and let the magic begin';
$pattern .= '\\\n - Extremely Simple: Just look at the name...It\'s Cake';
$pattern .= '\\\n - Active, Friendly Community: Join us #cakephp on IRC. We\'d love to help you get started';
$pattern .= '"\nmsgstr ""/';
$this->assertPattern($pattern, $result);
$pattern = '/\#: (\\\\|\/)extract\.ctp:26\n';
$pattern .= 'msgid "Found "/';
$this->assertNoPattern($pattern, $result);
// extract.ctp - reading the domain.pot
$result = file_get_contents($path . DS . 'domain.pot');
@ -156,7 +168,7 @@ class ExtractTaskTest extends CakeTestCase {
$Folder->delete();
}
function getTests() {
return array('start', 'startCase', 'testExtractMultiplePaths', 'endCase', 'end');
return array('start', 'startCase', 'testExecute', 'testExtractMultiplePaths', 'endCase', 'end');
}
/**

View file

@ -11,4 +11,16 @@ __dn('domain', 'You have %d new message (domain).', 'You have %d new messages (d
__dn('domain', 'You deleted %d message (domain).', 'You deleted %d messages (domain).', $messages['count']);
// Duplicated Message
__('Editing this Page');
__('Editing this Page');
// Multiline with comments
__('Hot features!'
. "\n - No Configuration:" // Comments will be stripped
. ' Set-up the database and let the magic begin'
. "\n - Extremely Simple:" // Comments will be stripped
. ' Just look at the name...It\'s Cake'
. "\n - Active, Friendly Community:" // Comments will be stripped
. ' Join us #cakephp on IRC. We\'d love to help you get started');
// This throws an error and is not parsed
__('Found ' . $count . ' new messages');