Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Backport unit tests from branch 2.0 (tests for strings concatenated w…

…ith '.')
  • Loading branch information...
commit cd14874b5969bc7c8932b7d2228e76ad253cb4c9 1 parent 200c85c
@zoydsan zoydsan authored markstory committed
View
14 cake/tests/cases/console/libs/tasks/extract.test.php
@@ -139,6 +139,18 @@ function testExecute() {
$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 @@ function testExecute() {
$Folder->delete();
}
function getTests() {
- return array('start', 'startCase', 'testExtractMultiplePaths', 'endCase', 'end');
+ return array('start', 'startCase', 'testExecute', 'testExtractMultiplePaths', 'endCase', 'end');
}
/**
View
14 cake/tests/test_app/views/pages/extract.ctp
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.