예제 #1
0
 /**
  * @covers Patchwork\Utf8::count_chars
  * @expectedException PHPUnit_Framework_Error_Warning
  */
 function testCountChars()
 {
     $c = "déjà 한국어";
     $c .= n::normalize($c, n::NFD);
     $e = array('d' => 2, 'é' => 1, 'j' => 2, 'à' => 1, ' ' => 2, '한' => 1, '국' => 1, '어' => 1, 'é' => 1, 'à' => 1, '한' => 1, '국' => 1, '어' => 1);
     $this->assertSame($e, u::count_chars($c, 1));
     $this->assertSame($e, u::count_chars($c));
     $this->assertFalse(true, 'The previous line should trigger a warning (the only allowed $mode is 1)');
 }