Skip to content
This repository
Browse code

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

…ith '.')
  • Loading branch information...
commit cd14874b5969bc7c8932b7d2228e76ad253cb4c9 1 parent 200c85c
zoydsan authored September 08, 2011 markstory committed September 08, 2011
14  cake/tests/cases/console/libs/tasks/extract.test.php
@@ -139,6 +139,18 @@ function testExecute() {
139 139
 		$pattern .= 'msgid "Editing this Page"\nmsgstr ""/';
140 140
 		$this->assertPattern($pattern, $result);
141 141
 
  142
+		$pattern = '/\#: (\\\\|\/)extract\.ctp:17\nmsgid "';
  143
+		$pattern .= 'Hot features!';
  144
+		$pattern .= '\\\n - No Configuration: Set-up the database and let the magic begin';
  145
+		$pattern .= '\\\n - Extremely Simple: Just look at the name...It\'s Cake';
  146
+		$pattern .= '\\\n - Active, Friendly Community: Join us #cakephp on IRC. We\'d love to help you get started';
  147
+		$pattern .= '"\nmsgstr ""/';
  148
+		$this->assertPattern($pattern, $result);
  149
+
  150
+		$pattern = '/\#: (\\\\|\/)extract\.ctp:26\n';
  151
+		$pattern .= 'msgid "Found "/';
  152
+		$this->assertNoPattern($pattern, $result);
  153
+
142 154
 		// extract.ctp - reading the domain.pot
143 155
 		$result = file_get_contents($path . DS . 'domain.pot');
144 156
 
@@ -156,7 +168,7 @@ function testExecute() {
156 168
 		$Folder->delete();
157 169
 	}
158 170
 	function getTests() {
159  
-		return array('start', 'startCase', 'testExtractMultiplePaths', 'endCase', 'end');
  171
+		return array('start', 'startCase', 'testExecute', 'testExtractMultiplePaths', 'endCase', 'end');
160 172
 	}
161 173
 
162 174
 /**
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
11 11
 __dn('domain', 'You deleted %d message (domain).', 'You deleted %d messages (domain).', $messages['count']);
12 12
 
13 13
 // Duplicated Message
14  
-__('Editing this Page');
  14
+__('Editing this Page');
  15
+
  16
+// Multiline with comments
  17
+__('Hot features!'
  18
+  . "\n - No Configuration:"				// Comments will be stripped
  19
+		. ' Set-up the database and let the magic begin'
  20
+	. "\n - Extremely Simple:"				// Comments will be stripped
  21
+		. ' Just look at the name...It\'s Cake'
  22
+	. "\n - Active, Friendly Community:"	// Comments will be stripped
  23
+		. ' Join us #cakephp on IRC. We\'d love to help you get started');
  24
+
  25
+// This throws an error and is not parsed
  26
+__('Found ' . $count . ' new messages');

0 notes on commit cd14874

Please sign in to comment.
Something went wrong with that request. Please try again.