ソースを参照

different approach

euromark 12 年 前
コミット
f6b5c3115d
1 ファイル変更4 行追加4 行削除
  1. 4 4
      Test/Case/Lib/Utility/UtilityTest.php

+ 4 - 4
Test/Case/Lib/Utility/UtilityTest.php

@@ -46,7 +46,7 @@ class UtilityTest extends MyCakeTestCase {
 		$this->assertSame(array($string, 'äöü'), $matches);
 
 		$string = 'D-81245 München';
-		preg_match('/(*UTF8)([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/i', $string, $matches);
+		preg_match('/(*UTF8)([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/iu', $string, $matches);
 		$expected = array(
 			$string,
 			'D',
@@ -56,13 +56,13 @@ class UtilityTest extends MyCakeTestCase {
 		$this->assertSame($expected, $matches);
 
 		// we dont need the utf8 hack:
-		Utility::pregMatch('/([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/i', $string, $matches);
+		Utility::pregMatch('/([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/iu', $string, $matches);
 		$this->assertSame($expected, $matches);
 	}
 
 	public function testPregMatchAll() {
 		$string = 'D-81245 München';
-		preg_match_all('/([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/i', $string, $matches, PREG_SET_ORDER);
+		preg_match_all('/(*UTF8)([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/iu', $string, $matches, PREG_SET_ORDER);
 		$expected = array(
 			array(
 				$string,
@@ -74,7 +74,7 @@ class UtilityTest extends MyCakeTestCase {
 		$this->assertSame($expected, $matches);
 
 		// we dont need the utf8 hack:
-		Utility::pregMatchAll('/([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/i', $string, $matches);
+		Utility::pregMatchAll('/([\w+])-([a-z0-9]+)\s+\b([\w\s]+)\b/iu', $string, $matches);
 		$this->assertSame($expected, $matches);
 	}