Skip to content

Commit c31dc87

Browse files
committed
prepare release, use class constants in all tests
1 parent aed7e5a commit c31dc87

15 files changed

+65
-89
lines changed

CHANGELOG.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5-
## 1.16.0 - unreleased
5+
## 1.16.0 - 2019-06-05
66

77
### Changed
88

@@ -12,12 +12,11 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
1212
### Added
1313

1414
- Integration for VCR Plugin
15-
- curl-client v1.* is marked in conflict with the current bundle version.
1615

1716
### Fixed
1817

19-
- Fix compatibility with curl-client v2.*, the `CurlFactory` now build the
20-
client using PSR17 factories.
18+
- Fix compatibility with curl-client `2.*`. The `CurlFactory` now builds the
19+
client using PSR-17 factories. Marked a conflict for curl-client `1.*`.
2120

2221
## 1.15.2 - 2019-04-18
2322

tests/Functional/DiscoveryTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\ContainerBuilderHasAliasConstraint;
1414
use PHPUnit\Framework\Constraint\LogicalNot;
1515
use Symfony\Component\DependencyInjection\Definition;
16+
use Http\Adapter\Guzzle6\Client;
1617

1718
/**
1819
* @author Márk Sági-Kazár <[email protected]>
@@ -50,9 +51,9 @@ public function testDiscoveryFallbacks()
5051
public function testDiscoveryPartialFallbacks()
5152
{
5253
$this->load();
53-
$this->setDefinition('httplug.client.default', new Definition('Http\Adapter\Guzzle6\Client'));
54+
$this->setDefinition('httplug.client.default', new Definition(Client::class));
5455

55-
$this->assertContainerBuilderHasService('httplug.client.default', 'Http\Adapter\Guzzle6\Client');
56+
$this->assertContainerBuilderHasService('httplug.client.default', Client::class);
5657
$this->assertContainerBuilderHasService('httplug.message_factory.default', MessageFactory::class);
5758
$this->assertContainerBuilderHasService('httplug.uri_factory.default', UriFactory::class);
5859
$this->assertContainerBuilderHasService('httplug.stream_factory.default', StreamFactory::class);

tests/Functional/Issue206.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testCustomClientDoesNotCauseException()
1717
{
1818
static::bootKernel();
1919
$container = static::$kernel->getContainer();
20-
PluginClientFactory::setFactory([$container->get('Http\Client\Common\PluginClientFactory'), 'createClient']);
20+
PluginClientFactory::setFactory([$container->get(PluginClientFactory::class), 'createClient']);
2121

2222
// Create a client
2323
$myCustomClient = new HttpMethodsClient(HttpClientDiscovery::find(), MessageFactoryDiscovery::find());

tests/Functional/ProfilingTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,14 @@ public function testProfilingWithCachePlugin()
6464
$this->assertEquals('example.com', $stack->getRequestHost());
6565
}
6666

67-
/**
68-
* @expectedException \Exception
69-
*/
7067
public function testProfilingWhenPluginThrowException()
7168
{
7269
$client = $this->createClient([
7370
new ExceptionThrowerPlugin(),
7471
]);
7572

7673
try {
74+
$this->expectException(\Exception::class);
7775
$client->sendRequest(new Request('GET', 'https://example.com'));
7876
} finally {
7977
$this->assertCount(1, $this->collector->getStacks());

tests/Functional/ServiceInstantiationTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Http\HttplugBundle\Tests\Functional;
44

5+
use GuzzleHttp\Psr7\Request as GuzzleRequest;
56
use Http\Client\Common\Plugin\RedirectPlugin;
67
use Http\Client\Common\PluginClient;
78
use Http\Client\HttpClient;
@@ -14,7 +15,7 @@
1415
use Psr\Http\Message\ResponseInterface;
1516
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
1617
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
17-
use Symfony\Component\HttpFoundation\Request;
18+
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
1819
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
1920
use Symfony\Component\HttpKernel\HttpKernelInterface;
2021
use Symfony\Component\HttpKernel\Kernel;
@@ -98,7 +99,7 @@ public function testProfilingPsr18Decoration()
9899
$psr18Client = NSA::getProperty($flexibleClient, 'httpClient');
99100
$this->assertInstanceOf(ClientInterface::class, $psr18Client);
100101

101-
$response = $client->sendRequest(new \GuzzleHttp\Psr7\Request('GET', 'https://example.com'));
102+
$response = $client->sendRequest(new GuzzleRequest('GET', 'https://example.com'));
102103
$this->assertInstanceOf(ResponseInterface::class, $response);
103104
}
104105

@@ -112,7 +113,7 @@ protected static function bootKernel(array $options = [])
112113
/** @var EventDispatcherInterface $dispatcher */
113114
$dispatcher = static::$kernel->getContainer()->get('event_dispatcher');
114115

115-
$event = new GetResponseEvent(static::$kernel, new Request(), HttpKernelInterface::MASTER_REQUEST);
116+
$event = new GetResponseEvent(static::$kernel, new SymfonyRequest(), HttpKernelInterface::MASTER_REQUEST);
116117

117118
if (version_compare(Kernel::VERSION, '4.3.0', '>=')) {
118119
$dispatcher->dispatch($event, KernelEvents::REQUEST);

tests/Unit/ClientFactory/BuzzFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BuzzFactoryTest extends TestCase
1414
{
1515
public function testCreateClient()
1616
{
17-
if (!class_exists(\Http\Adapter\Buzz\Client::class)) {
17+
if (!class_exists(Client::class)) {
1818
$this->markTestSkipped('Buzz adapter is not installed');
1919
}
2020

tests/Unit/ClientFactory/CurlFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class CurlFactoryTest extends TestCase
1515
{
1616
public function testCreateClient()
1717
{
18-
if (!class_exists(\Http\Client\Curl\Client::class)) {
18+
if (!class_exists(Client::class)) {
1919
$this->markTestSkipped('Curl client is not installed');
2020
}
2121

tests/Unit/ClientFactory/Guzzle6FactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Guzzle6FactoryTest extends TestCase
1313
{
1414
public function testCreateClient()
1515
{
16-
if (!class_exists(\Http\Adapter\Guzzle6\Client::class)) {
16+
if (!class_exists(Client::class)) {
1717
$this->markTestSkipped('Guzzle6 adapter is not installed');
1818
}
1919

tests/Unit/ClientFactory/ReactFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ReactFactoryTest extends TestCase
1414
{
1515
public function testCreateClient()
1616
{
17-
if (!class_exists(\Http\Adapter\React\Client::class)) {
17+
if (!class_exists(Client::class)) {
1818
$this->markTestSkipped('React adapter is not installed');
1919
}
2020

tests/Unit/ClientFactory/SocketFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SocketFactoryTest extends TestCase
1414
{
1515
public function testCreateClient()
1616
{
17-
if (!class_exists(\Http\Client\Socket\Client::class)) {
17+
if (!class_exists(Client::class)) {
1818
$this->markTestSkipped('Socket client is not installed');
1919
}
2020

0 commit comments

Comments
 (0)