EOF
));
} public function testFormatAndWrap() { $formatter =
new OutputFormatter(true
);
$this->
assertSame("fo\no\e[37;41mb\e[39;49m\n\e[37;41mar\e[39;49m\nba\nz",
$formatter->
formatAndWrap('foo<error>bar</error> baz', 2
));
$this->
assertSame("pr\ne \e[37;41m\e[39;49m\n\e[37;41mfo\e[39;49m\n\e[37;41mo\e[39;49m\n\e[37;41mba\e[39;49m\n\e[37;41mr\e[39;49m\n\e[37;41mba\e[39;49m\n\e[37;41mz\e[39;49m \npo\nst",
$formatter->
formatAndWrap('pre <error>foo bar baz</error> post', 2
));
$this->
assertSame("pre\e[37;41m\e[39;49m\n\e[37;41mfoo\e[39;49m\n\e[37;41mbar\e[39;49m\n\e[37;41mbaz\e[39;49m\npos\nt",
$formatter->
formatAndWrap('pre <error>foo bar baz</error> post', 3
));
$this->
assertSame("pre \e[37;41m\e[39;49m\n\e[37;41mfoo\e[39;49m\n\e[37;41mbar\e[39;49m\n\e[37;41mbaz\e[39;49m \npost",
$formatter->
formatAndWrap('pre <error>foo bar baz</error> post', 4
));
$this->
assertSame("pre \e[37;41mf\e[39;49m\n\e[37;41moo\e[39;49m\n\e[37;41mbar\e[39;49m\n\e[37;41mbaz\e[39;49m p\nost",
$formatter->
formatAndWrap('pre <error>foo bar baz</error> post', 5
));
$this->
assertSame("Lore\nm \e[37;41mip\e[39;49m\n\e[37;41msum\e[39;49m \ndolo\nr \e[32msi\e[39m\n\e[32mt\e[39m am\net",
$formatter->
formatAndWrap('Lorem <error>ipsum</error> dolor <info>sit</info> amet', 4
));
$this->
assertSame("Lorem \e[37;41mip\e[39;49m\n\e[37;41msum\e[39;49m dolo\nr \e[32msit\e[39m am\net",
$formatter->
formatAndWrap('Lorem <error>ipsum</error> dolor <info>sit</info> amet', 8
));
$this->
assertSame("Lorem \e[37;41mipsum\e[39;49m dolor \e[32m\e[39m\n\e[32msit\e[39m, \e[37;41mamet\e[39;49m et \e[32mlauda\e[39m\n\e[32mntium\e[39m architecto",
$formatter->
formatAndWrap('Lorem <error>ipsum</error> dolor <info>sit</info>, <error>amet</error> et <info>laudantium</info> architecto', 18
));
$formatter =
new OutputFormatter();
$this->
assertSame("fo\nob\nar\nba\nz",
$formatter->
formatAndWrap('foo<error>bar</error> baz', 2
));