Add test and fix warnings
This commit is contained in:
parent
5e2374be4a
commit
d84da93a36
|
|
@ -78,13 +78,13 @@ class SDT extends Text
|
|||
*
|
||||
* @see http://www.datypic.com/sc/ooxml/t-w_CT_SdtText.html
|
||||
* @param \PhpOffice\Common\XMLWriter $xmlWriter
|
||||
* @param \PhpOffice\PhpWord\Element\SDT $element
|
||||
*/
|
||||
private function writePlainText(XMLWriter $xmlWriter, SDTElement $element)
|
||||
private function writePlainText(XMLWriter $xmlWriter)
|
||||
{
|
||||
$xmlWriter->startElement("w:text");
|
||||
$xmlWriter->endElement(); // w:{$type}
|
||||
$xmlWriter->startElement('w:text');
|
||||
$xmlWriter->endElement(); // w:text
|
||||
}
|
||||
|
||||
/**
|
||||
* Write combo box.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ class ElementTest extends \PHPUnit\Framework\TestCase
|
|||
$section->addSDT('comboBox')->setListItems(array('1' => 'Choice 1', '2' => 'Choice 2'))->setValue('select value');
|
||||
$section->addSDT('dropDownList');
|
||||
$section->addSDT('date')->setAlias('date_alias')->setTag('my_tag');
|
||||
$section->addSDT('plainText');
|
||||
|
||||
$doc = TestHelperDOCX::getDocument($phpWord);
|
||||
|
||||
|
|
@ -405,6 +406,8 @@ class ElementTest extends \PHPUnit\Framework\TestCase
|
|||
$this->assertTrue($doc->elementExists($path . '[3]/w:sdt/w:sdtPr/w:date'));
|
||||
$this->assertTrue($doc->elementExists($path . '[3]/w:sdt/w:sdtPr/w:alias'));
|
||||
$this->assertTrue($doc->elementExists($path . '[3]/w:sdt/w:sdtPr/w:tag'));
|
||||
|
||||
$this->assertTrue($doc->elementExists($path . '[4]/w:sdt/w:sdtPr/w:text'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue