Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb78fff4

Browse files
committed
[Console] [SymfonyStyle] Replace long word wrapping test to directly test output
1 parenta842b97 commitb78fff4

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
useSymfony\Component\Console\Input\InputInterface;
4+
useSymfony\Component\Console\Output\OutputInterface;
5+
useSymfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
6+
7+
//Ensure long words are properly wrapped in blocks
8+
returnfunction (InputInterface$input,OutputInterface$output) {
9+
$word ='Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon';
10+
$sfStyle =newSymfonyStyleWithForcedLineLength($input,$output);
11+
$sfStyle->block($word,'CUSTOM','fg=white;bg=blue',' §',false);
12+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
§ [CUSTOM] Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophatto
3+
§ peristeralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon
4+

‎src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,6 @@ public function inputCommandToOutputFilesProvider()
5454

5555
returnarray_map(null,glob($baseDir.'/command/command_*.php'),glob($baseDir.'/output/output_*.txt'));
5656
}
57-
58-
publicfunctiontestLongWordsBlockWrapping()
59-
{
60-
$word ='Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygovgollhjvhvljfezefeqifzeiqgiqzhrsdgihqzridghqridghqirshdghdghieridgheirhsdgehrsdvhqrsidhqshdgihrsidvqhneriqsdvjzergetsrfhgrstsfhsetsfhesrhdgtesfhbzrtfbrztvetbsdfbrsdfbrn';
61-
$wordLength =strlen($word);
62-
$maxLineLength = SymfonyStyle::MAX_LINE_LENGTH -3;
63-
64-
$this->command->setCode(function (InputInterface$input,OutputInterface$output)use ($word) {
65-
$sfStyle =newSymfonyStyleWithForcedLineLength($input,$output);
66-
$sfStyle->block($word,'CUSTOM','fg=white;bg=blue',' §',false);
67-
});
68-
69-
$this->tester->execute(array(),array('interactive' =>false,'decorated' =>false));
70-
$expectedCount = (int)ceil($wordLength / ($maxLineLength)) + (int) ($wordLength >$maxLineLength -5);
71-
$this->assertSame($expectedCount,substr_count($this->tester->getDisplay(true),' §'));
72-
}
7357
}
7458

7559
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp