Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve some of the tests #292

Merged
merged 1 commit into from Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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