8000 Merge branch '5.4' into 6.4 · symfony/symfony@68eaede · GitHub
[go: up one dir, main page]

Skip to content

Commit 68eaede

Browse files
Merge branch '5.4' into 6.4
* 5.4: [Filesystem][Mime] Fix transient tests Test convert CompletionInput into string
2 parents cdb8354 + fd32ec5 commit 68eaede

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/Symfony/Component/Console/Completion/CompletionInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function fromString(string $inputStr, int $currentIndex): self
5353
* Create an input based on an COMP_WORDS token list.
5454
*
5555
* @param string[] $tokens the set of split tokens (e.g. COMP_WORDS or argv)
56-
* @param $currentIndex the index of the cursor (e.g. COMP_CWORD)
56+
* @param int $currentIndex the index of the cursor (e.g. COMP_CWORD)
5757
*/
5858
public static function fromTokens(array $tokens, int $currentIndex): self
5959
{

src/Symfony/Component/Console/Tests/Completion/CompletionInputTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,19 @@ public static function provideFromStringData()
132132
yield ['bin/console cache:clear "multi word string"', ['bin/console', 'cache:clear', '"multi word string"']];
133133
yield ['bin/console cache:clear \'multi word string\'', ['bin/console', 'cache:clear', '\'multi word string\'']];
134134
}
135+
136+
public function testToString()
137+
{
138+
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 0);
139+
$this->assertSame('foo| bar baz', (string) $input);
140+
141+
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 1);
142+
$this->assertSame('foo bar| baz', (string) $input);
143+
144+
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 2);
145+
$this->assertSame('foo bar baz|', (string) $input);
146+
147+
$input = CompletionInput::fromTokens(['foo', 'bar', 'baz'], 11);
148+
$this->assertSame('foo bar baz |', (string) $input);
149+
}
135150
}

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,17 @@ public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToCopy()
171171
}
172172

173173
$finder = new PhpExecutableFinder();
174-
$process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8057']));
174+
$process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8857']));
175175
$process->setWorkingDirectory(__DIR__.'/Fixtures/web');
176176

177177
$process->start();
178178

179179
do {
180180
usleep(50000);
181-
} while (!@fopen('http://localhost:8057', 'r'));
181+
} while (!@fopen('http://localhost:8857', 'r'));
182182

183183
try {
184-
$sourceFilePath = 'http://localhost:8057/logo_symfony_header.png';
184+
$sourceFilePath = 'http://localhost:8857/logo_symfony_header.png';
185185
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
186186
file_put_contents($targetFilePath, 'TARGET FILE');
187187
$this->filesystem->copy($sourceFilePath, $targetFilePath, false);

src/Symfony/Component/Mime/Tests/Part/DataPartTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ public function testFromPathWithUrl()
143143
}
144144

145145
$finder = new PhpExecutableFinder();
146-
$process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8057']));
146+
$process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', 'localhost:8856']));
147147
$process->setWorkingDirectory(__DIR__.'/../Fixtures/web');
148148
$process->start();
149149

150150
try {
151151
do {
152152
usleep(50000);
153-
} while (!@fopen('http://localhost:8057', 'r'));
154-
$p = DataPart::fromPath($file = 'http://localhost:8057/logo_symfony_header.png');
153+
} while (!@fopen('http://localhost:8856', 'r'));
154+
$p = DataPart::fromPath($file = 'http://localhost:8856/logo_symfony_header.png');
155155
$content = file_get_contents($file);
156156
$this->assertEquals($content, $p->getBody());
157157
$maxLineLength = 76;

0 commit comments

Comments
 (0)
0