Skip to content

Commit

Permalink
Merge pull request #292 from php-http/improve-tests
Browse files Browse the repository at this point in the history
improve some of the tests
  • Loading branch information
dbu committed Dec 13, 2018
2 parents 480b7fa + 25c52ef commit e01c3be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Tests/Functional/DiscoveryTest.php
Expand Up @@ -4,6 +4,7 @@

use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Http\Discovery\HttpClientDiscovery;
use Http\HttplugBundle\DependencyInjection\HttplugExtension;
use Http\Message\MessageFactory;
use Http\Message\StreamFactory;
Expand Down Expand Up @@ -65,5 +66,9 @@ public function testNoDiscoveryFallbacks()
$this->setDefinition('httplug.async_client.default', new Definition(HttpAsyncClient::class));

$this->load();

$this->assertContainerBuilderHasService('httplug.client.default', HttpClient::class);
$clientDefinition = $this->container->getDefinition('httplug.client.default');
$this->assertEquals([HttpClientDiscovery::class, 'find'], $clientDefinition->getFactory());
}
}
4 changes: 2 additions & 2 deletions Tests/Unit/Collector/FormatterTest.php
Expand Up @@ -14,12 +14,12 @@
class FormatterTest extends TestCase
{
/**
* @var MessageFormatter
* @var MessageFormatter|\PHPUnit_Framework_MockObject_MockObject
*/
private $formatter;

/**
* @var MessageFormatter
* @var CurlCommandFormatter|\PHPUnit_Framework_MockObject_MockObject
*/
private $curlFormatter;

Expand Down
2 changes: 2 additions & 0 deletions Tests/Unit/DependencyInjection/HttplugExtensionTest.php
Expand Up @@ -2,6 +2,7 @@

namespace Http\HttplugBundle\Tests\Unit\DependencyInjection;

use Http\Client\HttpClient;
use Http\HttplugBundle\Collector\PluginClientFactoryListener;
use Http\HttplugBundle\DependencyInjection\HttplugExtension;
use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase;
Expand Down Expand Up @@ -265,6 +266,7 @@ public function testUsingServiceKeyForClients()
private function verifyProfilingDisabled()
{
$def = $this->container->findDefinition('httplug.client');
$this->assertTrue(is_subclass_of($def->getClass(), HttpClient::class));
$arguments = $def->getArguments();

if (isset($arguments[3])) {
Expand Down

0 comments on commit e01c3be

Please sign in to comment.