/**
  * Tests the trimText method.
  */
 public function testTrimText()
 {
     // Test unicode. See https://www.drupal.org/node/513396#comment-2839416.
     $text = array('Tuy nhiên, những hi vọng', 'Giả sử chúng tôi có 3 Apple', 'siêu nhỏ này là bộ xử lý', 'Di động của nhà sản xuất Phần Lan', 'khoảng cách từ đại lí đến', 'của hãng bao gồm ba dòng', 'сд асд асд ас', 'асд асд асд ас');
     // Just test maxlength without word boundary.
     $alter = array('max_length' => 10);
     $expect = array('Tuy nhiên,', 'Giả sử chú', 'siêu nhỏ n', 'Di động củ', 'khoảng các', 'của hãng b', 'сд асд асд', 'асд асд ас');
     foreach ($text as $key => $line) {
         $result_text = FieldPluginBase::trimText($alter, $line);
         $this->assertEqual($result_text, $expect[$key]);
     }
     // Test also word_boundary
     $alter['word_boundary'] = TRUE;
     $expect = array('Tuy nhiên', 'Giả sử', 'siêu nhỏ', 'Di động', 'khoảng', 'của hãng', 'сд асд', 'асд асд');
     foreach ($text as $key => $line) {
         $result_text = FieldPluginBase::trimText($alter, $line);
         $this->assertEqual($result_text, $expect[$key]);
     }
 }