public function testTonelessWithSpaces() { $source = ' 台灣華語 羅馬拼音 THL '; $expect = ' tai wan hua yu luo ma pin yin THL '; $output = Pinyin::pinyin($source, array("tone" => "none", "split" => "word")); $this->assertSame($expect, $output); $source = ' 台灣華語 羅馬拼音 THL '; $expect = ' taiwan huayu luoma pinyin THL '; $output = Pinyin::pinyin($source, array("tone" => "none", "split" => "phrase")); $this->assertSame($expect, $output); $source = ' 仁愛白鵝 海鷗長女 '; $expect = " ren'ai bai'e hai'ou jhang'nyu "; $output = Pinyin::pinyin($source, array("tone" => "none", "split" => "phrase")); $this->assertSame($expect, $output); }