getText()); self::assertInstanceOf('PhpOffice\\PhpWord\\Style\\Font', $oText->getFontStyle()); self::assertInstanceOf('PhpOffice\\PhpWord\\Style\\Paragraph', $oText->getParagraphStyle()); } /** * Get text. */ public function testText(): void { $oText = new Text('text'); self::assertEquals('text', $oText->getText()); } /** * Get font style. */ public function testFont(): void { $oText = new Text('text', 'fontStyle'); self::assertEquals('fontStyle', $oText->getFontStyle()); $oText->setFontStyle(['bold' => true, 'italic' => true, 'size' => 16]); self::assertInstanceOf('PhpOffice\\PhpWord\\Style\\Font', $oText->getFontStyle()); } /** * Get font style as object. */ public function testFontObject(): void { $font = new Font(); $oText = new Text('text', $font); self::assertEquals($font, $oText->getFontStyle()); } /** * Get paragraph style. */ public function testParagraph(): void { $oText = new Text('text', 'fontStyle', 'paragraphStyle'); self::assertEquals('paragraphStyle', $oText->getParagraphStyle()); $oText->setParagraphStyle(['alignment' => Jc::CENTER, 'spaceAfter' => 100]); self::assertInstanceOf('PhpOffice\\PhpWord\\Style\\Paragraph', $oText->getParagraphStyle()); } }