示例#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
 /**
  * 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;
 }