Skip to content

Commit

Permalink
Support symfony/console 5 and amphp/http-client 4.0.0.-rc7+
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed Nov 17, 2019
1 parent e28eb01 commit ceaac2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"amphp/socket": "^1",
"jean85/pretty-package-versions": "^1.1",
"psr/log": "^1.1",
"symfony/console": "^4.1@beta",
"symfony/console": "^4.1@beta|^5.0",
"symfony/polyfill-php72": "^1.7"
},
"require-dev": {
"amphp/http-client": "^4.0@rc",
"amphp/http-client": "^4.0.0-rc7",
"amphp/parallel": "^1.0.1",
"amphp/process": "^1.0.3",
"phpunit/php-code-coverage": "^6.1|^7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
return Helper::formatMemory($bar->getMaxSteps());
});
SymfonyProgressBar::setPlaceholderFormatterDefinition('host', function (SymfonyProgressBar $bar) {
return Helper::formatMemory($bar->host);
return $bar->host;
});

class ProgressBar
Expand Down
10 changes: 6 additions & 4 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
namespace Ostrolucky\Stdinho\Tests;

use Amp\Delayed;
use Amp\Http\Client\Client;
use Amp\Http\Client\HttpClient;
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\Request;
use Amp\Http\Client\Response;
use Amp\Loop;
use Amp\Process\Process;
Expand All @@ -20,7 +22,7 @@ class FunctionalTest extends TestCase
*/
private $process;
/**
* @var Client
* @var HttpClient
*/
private $httpClient;
/**
Expand All @@ -41,7 +43,7 @@ protected function setUp(): void
});
$executable = $isCoverageEnabled ? 'coverage-enabling-bin-wrapper.php' : '../bin/stdinho';
$this->command = 'php '.__DIR__."/$executable --connections-limit=1 localhost:1338 ";
$this->httpClient = new Client();
$this->httpClient = HttpClientBuilder::buildDefault();
});
}

Expand All @@ -66,7 +68,7 @@ public function testStdinIsWrittenToSocketASAP(string $cliArguments): void
yield new Delayed(60);

/** @var Response $response */
$response = yield $this->httpClient->request('http://localhost:1338');
$response = yield $this->httpClient->request(new Request('http://localhost:1338'));
self::assertEquals('foo', yield $response->getBody()->read()); // drain the buffer

yield $this->process->getStdin()->write('bar');
Expand Down

0 comments on commit ceaac2a

Please sign in to comment.