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

Appearance settings

Commit 04be521

Browse filesBrowse files
committed
use local PHP web server to test HTTP stream wrappers
1 parent 2d3300e commit 04be521
Copy full SHA for 04be521

File tree

3 files changed

+13
-4
lines changed
Filter options

3 files changed

+13
-4
lines changed
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php
Loading

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/Tests/Part/DataPartTest.php
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
use Symfony\Component\Mime\Header\ParameterizedHeader;
1919
use Symfony\Component\Mime\Header\UnstructuredHeader;
2020
use Symfony\Component\Mime\Part\DataPart;
21+
use Symfony\Component\Process\PhpExecutableFinder;
22+
use Symfony\Component\Process\Process;
2123

2224
class DataPartTest extends TestCase
2325
{
@@ -134,16 +136,22 @@ public function testFromPathWithNotAFile()
134136
DataPart::fromPath(__DIR__.'/../Fixtures/mimetypes/');
135137
}
136138

137-
/**
138-
* @group network
139-
*/
140139
public function testFromPathWithUrl()
141140
{
142141
if (!\in_array('https', stream_get_wrappers())) {
143142
$this->markTestSkipped('"https" stream wrapper is not enabled.');
144143
}
145144

146-
$p = DataPart::fromPath($file = 'https://symfony.com/images/common/logo/logo_symfony_header.png');
145+
$finder = new PhpExecutableFinder();
146+
$process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', '127.0.0.1:8057']));
147+
$process->setWorkingDirectory(__DIR__.'/../Fixtures/web');
148+
$process->start();
149+
150+
do {
151+
usleep(50000);
152+
} while (!@fopen('http://127.0.0.1:8057', 'r'));
153+
154+
$p = DataPart::fromPath($file = 'http://localhost:8057/logo_symfony_header.png');
147155
$content = file_get_contents($file);
148156
$this->assertEquals($content, $p->getBody());
149157
$maxLineLength = 76;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.