Browse Source

fix tests

euromark 12 years ago
parent
commit
484cd371d7

+ 3 - 3
Test/Case/View/Helper/TypographyHelperTest.php

@@ -44,7 +44,7 @@ class TypographyHelperTest extends MyCakeTestCase {
 		$strs = array(
 		$strs = array(
 			'"double quotes"' => '“double quotes”',
 			'"double quotes"' => '“double quotes”',
 			'"testing" in "theory" that is' => '“testing” in “theory” that is',
 			'"testing" in "theory" that is' => '“testing” in “theory” that is',
-			"Here's what I'm" => 'Here’s what I’m',
+			"Here's what I'm" => 'Here’s what I’m',
 			'&' => '&',
 			'&' => '&',
 			'&' => '&',
 			'&' => '&',
 			' ' => ' ',
 			' ' => ' ',
@@ -65,7 +65,7 @@ class TypographyHelperTest extends MyCakeTestCase {
 		$strs = array(
 		$strs = array(
 			'"double quotes"' 				=> '„double quotes‟',
 			'"double quotes"' 				=> '„double quotes‟',
 			'"testing" in "theory" that is' => '„testing‟ in „theory‟ that is',
 			'"testing" in "theory" that is' => '„testing‟ in „theory‟ that is',
-			"Here's what I'm" 				=> 'Here‛s what I‛m',
+			"Here's what I'm" 				=> 'Here’s what I’m',
 		);
 		);
 		foreach ($strs as $str => $expected) {
 		foreach ($strs as $str => $expected) {
 			$result = $this->Typography->formatCharacters($str);
 			$result = $this->Typography->formatCharacters($str);
@@ -77,7 +77,7 @@ class TypographyHelperTest extends MyCakeTestCase {
 		$strs = array(
 		$strs = array(
 			'"double quotes"' 				=> '«double quotes»',
 			'"double quotes"' 				=> '«double quotes»',
 			'"testing" in "theory" that is' => '«testing» in «theory» that is',
 			'"testing" in "theory" that is' => '«testing» in «theory» that is',
-			"Here's what I'm" 				=> 'Here›s what I›m',
+			"Here's what I'm" 				=> 'Here’s what I’m',
 		);
 		);
 		foreach ($strs as $str => $expected) {
 		foreach ($strs as $str => $expected) {
 			$result = $this->Typography->formatCharacters($str);
 			$result = $this->Typography->formatCharacters($str);

+ 1 - 1
View/Helper/TypographyHelper.php

@@ -308,7 +308,7 @@ class TypographyHelper extends AppHelper {
 				'/(\W)"/'						=> '$1“',
 				'/(\W)"/'						=> '$1“',
 
 
 				// apostrophes
 				// apostrophes
-				"/(\w)'(\w)/"					=> '$1’$2',
+				"/(\w)'(\w)/"					=> '$1’$2', // we dont use #8217; to avoid collision on replace
 
 
 				// Em dash and ellipses dots
 				// Em dash and ellipses dots
 				'/\s?\-\-\s?/'					=> '—',
 				'/\s?\-\-\s?/'					=> '—',