Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
Example #1
0
 /**
  * Removes a style from the style set.
  *
  * @param string $tag The tag of the style to remove.
  *
  * @return static The current instance.
  *
  * @see StyleSet::remove()
  */
 public function removeStyle($tag)
 {
     if ($this->styleSet) {
         $this->styleSet->remove($tag);
     }
     return $this;
 }
Example #2
0
 public function testIsEmpty()
 {
     $styleSet = new StyleSet();
     $this->assertTrue($styleSet->isEmpty());
     $styleSet->add(Style::tag('style'));
     $this->assertFalse($styleSet->isEmpty());
 }
 public function testUseConfiguredStyleSet()
 {
     $styleSet = new StyleSet();
     $styleSet->add(Style::tag('custom'));
     $this->config->setStyleSet($styleSet)->beginCommand('command')->setHandler(new CallbackHandler(function (Args $args, IO $io) {
         PHPUnit_Framework_Assert::assertSame('text', $io->removeFormat('<custom>text</custom>'));
         return 123;
     }))->end();
     $application = new ConsoleApplication($this->config);
     $args = new StringArgs('command');
     $inputStream = new StringInputStream();
     $outputStream = new BufferedOutputStream();
     $errorStream = new BufferedOutputStream();
     $status = $application->run($args, $inputStream, $outputStream, $errorStream);
     $this->assertSame(123, $status);
 }