Esempio n. 1
0
 /**
  * Add title with predefined style
  */
 public function testAddTitleWithStyle()
 {
     Style::addTitleStyle(1, array('size' => 14));
     $section = new Section(0);
     $section->addTitle('Test', 1);
     $elementCollection = $section->getElements();
     $this->assertInstanceOf("PhpOffice\\PhpWord\\Element\\Title", $elementCollection[0]);
 }
Esempio n. 2
0
 /**
  * Add title with predefined style
  */
 public function testAddTitleWithStyle()
 {
     Style::addTitleStyle(1, array('size' => 14));
     $section = new Section(0);
     $section->setPhpWord(new PhpWord());
     $section->addTitle(htmlspecialchars('Test', ENT_COMPAT, 'UTF-8'), 1);
     $elementCollection = $section->getElements();
     $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Title', $elementCollection[0]);
 }