本文整理汇总了PHP中PhpOffice\PhpWord\Shared\XMLWriter::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter::getData方法的具体用法?PHP XMLWriter::getData怎么用?PHP XMLWriter::getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhpOffice\PhpWord\Shared\XMLWriter
的用法示例。
在下文中一共展示了XMLWriter::getData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testMethodExceptions
/**
* Test method exceptions
*/
public function testMethodExceptions()
{
$styles = array('Frame' => 'writeAlignment', 'Line' => 'writeStroke', 'TextBox' => 'writeBorder');
foreach ($styles as $style => $method) {
$objectClass = 'PhpOffice\\PhpWord\\Writer\\Word2007\\Style\\' . $style;
$xmlWriter = new XMLWriter();
$object = new $objectClass($xmlWriter);
$object->{$method}();
$this->assertEquals('', $xmlWriter->getData());
}
}
示例2: testEmptyStyles
/**
* Test empty styles
*/
public function testEmptyStyles()
{
$styles = array('Font', 'Paragraph', 'Image', 'Section', 'Table');
foreach ($styles as $style) {
$objectClass = 'PhpOffice\\PhpWord\\Writer\\ODText\\Style\\' . $style;
$xmlWriter = new XMLWriter();
$object = new $objectClass($xmlWriter);
$object->write();
$this->assertEquals('', $xmlWriter->getData());
}
}
示例3: testUnmatchedElements
/**
* Test unmatched elements
*/
public function testUnmatchedElements()
{
$elements = array('Image', 'Link', 'Table', 'Text', 'Title');
foreach ($elements as $element) {
$objectClass = 'PhpOffice\\PhpWord\\Writer\\ODText\\Element\\' . $element;
$xmlWriter = new XMLWriter();
$newElement = new \PhpOffice\PhpWord\Element\PageBreak();
$object = new $objectClass($xmlWriter, $newElement);
$object->write();
$this->assertEquals('', $xmlWriter->getData());
}
}
示例4: testUnmatchedElements
/**
* Test unmatched element
*/
public function testUnmatchedElements()
{
$elements = array('CheckBox', 'Container', 'Footnote', 'Image', 'Link', 'ListItem', 'ListItemRun', 'Object', 'PreserveText', 'Table', 'Text', 'TextBox', 'TextBreak', 'Title', 'TOC', 'Field', 'Line', 'Shape', 'Chart', 'FormField', 'SDT');
foreach ($elements as $element) {
$objectClass = 'PhpOffice\\PhpWord\\Writer\\Word2007\\Element\\' . $element;
$xmlWriter = new XMLWriter();
$newElement = new \PhpOffice\PhpWord\Element\PageBreak();
$object = new $objectClass($xmlWriter, $newElement);
$object->write();
$this->assertEquals('', $xmlWriter->getData());
}
}