/** * Add non-UTF8 */ public function testAddTextNotUTF8() { $oCell = new Cell('section', 1); $element = $oCell->addText(utf8_decode('ééé')); $this->assertCount(1, $oCell->getElements()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertEquals($element->getText(), 'ééé'); }
/** * Add non-UTF8 */ public function testAddTextNotUTF8() { $oCell = new Cell(); $element = $oCell->addText(utf8_decode(htmlspecialchars('ééé', ENT_COMPAT, 'UTF-8'))); $this->assertCount(1, $oCell->getElements()); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element); $this->assertEquals(htmlspecialchars('ééé', ENT_COMPAT, 'UTF-8'), $element->getText()); }