diff --git a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php new file mode 100644 index 0000000000..a4ef74e797 --- /dev/null +++ b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php @@ -0,0 +1,12 @@ +block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false); +}; diff --git a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt new file mode 100644 index 0000000000..190d784035 --- /dev/null +++ b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt @@ -0,0 +1,4 @@ + + § [CUSTOM] Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophatto + § peristeralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon + diff --git a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php index 889a9c82f2..e4ce037bb8 100644 --- a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php +++ b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php @@ -54,22 +54,6 @@ class SymfonyStyleTest extends PHPUnit_Framework_TestCase return array_map(null, glob($baseDir.'/command/command_*.php'), glob($baseDir.'/output/output_*.txt')); } - - public function testLongWordsBlockWrapping() - { - $word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygovgollhjvhvljfezefeqifzeiqgiqzhrsdgihqzridghqridghqirshdghdghieridgheirhsdgehrsdvhqrsidhqshdgihrsidvqhneriqsdvjzergetsrfhgrstsfhsetsfhesrhdgtesfhbzrtfbrztvetbsdfbrsdfbrn'; - $wordLength = strlen($word); - $maxLineLength = SymfonyStyle::MAX_LINE_LENGTH - 3; - - $this->command->setCode(function (InputInterface $input, OutputInterface $output) use ($word) { - $sfStyle = new SymfonyStyleWithForcedLineLength($input, $output); - $sfStyle->block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false); - }); - - $this->tester->execute(array(), array('interactive' => false, 'decorated' => false)); - $expectedCount = (int) ceil($wordLength / ($maxLineLength)) + (int) ($wordLength > $maxLineLength - 5); - $this->assertSame($expectedCount, substr_count($this->tester->getDisplay(true), ' § ')); - } } /**