public function test_phpdoc_template_maj_list() { $PHPWord = new PHPWord_Template($this->in . '/phpword_template_test.docx'); $dom = new DOMDocument(); $ret = $dom->load($this->in . '/document.xml'); $this->assertTrue($ret, 'chargement du xml'); $listBalise = $dom->getElementsByTagName('t'); $list = array('produit 1 ', 'produit2', 'produit3'); foreach ($listBalise as $balise) { $text = $balise->nodeValue; if ($text == '${products_std}') { $PHPWord->maj_list($text, $balise, $list); break; } } $dom->save($this->out . '/document.out.maj_list.xml'); $result = $dom->saveXML(); $expect = file_get_contents($this->in . '/document.maj_list.xml'); $this->assertEquals($expect, $result); $PHPWord->save($this->out . '/phpword_template_test.docx'); }