コード例 #1
0
ファイル: ParTest.php プロジェクト: jstewmc/rtf
 /**
  * run() should increment the paragraph index
  */
 public function testRun_incrementsParagraphIndex()
 {
     $style = new \Jstewmc\Rtf\Style();
     $old = $style->getParagraph()->getIndex();
     $element = new Par();
     $element->setStyle($style);
     $element->run();
     $new = $style->getParagraph()->getIndex();
     $this->assertGreaterThan($old, $new);
     return;
 }
コード例 #2
0
ファイル: UlnoneTest.php プロジェクト: jstewmc/rtf
 /**
  * run() should not underline (regardless of parameter's value)
  */
 public function testRun_doesNotUnderline()
 {
     $style = new \Jstewmc\Rtf\Style();
     $style->getCharacter()->setIsUnderline(true);
     $element = new Ulnone();
     $element->setStyle($style);
     $this->assertTrue($element->getStyle()->getCharacter()->getIsUnderline());
     $element->run();
     $this->assertFalse($element->getStyle()->getCharacter()->getIsUnderline());
     return;
 }
コード例 #3
0
ファイル: PardTest.php プロジェクト: jstewmc/rtf
 /**
  * run() should reset the paragraph state
  */
 public function testRun_resetsParagraphState()
 {
     $style = new \Jstewmc\Rtf\Style();
     $old = $style->getParagraph()->getIndex();
     $style->getParagraph()->setIndex(999);
     $element = new Pard();
     $element->setStyle($style);
     $element->run();
     $new = $style->getParagraph()->getIndex();
     $this->assertEquals($old, $new);
     return;
 }
コード例 #4
0
ファイル: PlainTest.php プロジェクト: jstewmc/rtf
 /**
  * run() should reset the character state
  */
 public function testRun_incrementsParagraphIndex()
 {
     $style = new \Jstewmc\Rtf\Style();
     $old = $style->getCharacter()->getIsBold();
     $style->getCharacter()->setIsBold(!$old);
     $element = new Plain();
     $element->setStyle($style);
     $element->run();
     $new = $style->getCharacter()->getIsBold();
     $this->assertEquals($old, $new);
     return;
 }