Esempio n. 1
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('Test', 1);
     $elementCollection = $section->getElements();
     $this->assertInstanceOf("PhpOffice\\PhpWord\\Element\\Title", $elementCollection[0]);
 }
Esempio n. 2
0
 /**
  * Create new section
  *
  * @param array $settings
  * @return \PhpOffice\PhpWord\Element\Section
  */
 public function addSection($settings = null)
 {
     $section = new Section(count($this->sections) + 1, $settings);
     $section->setPhpWord($this);
     $this->sections[] = $section;
     return $section;
 }
Esempio n. 3
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]);
 }