for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Http\HttplugBundle\Tests\Unit\ClientFactory;
use Http\HttplugBundle\ClientFactory\SymfonyFactory;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Symfony\Component\HttpClient\HttplugClient;
/**
* @author Tobias Nyholm <[email protected]>
*/
class SymfonyFactoryTest extends TestCase
{
public function testCreateClient(): void
if (!class_exists(HttplugClient::class)) {
$this->markTestSkipped('Symfony Http client is not installed');
}
$factory = new SymfonyFactory(
$this->getMockBuilder(ResponseFactoryInterface::class)->getMock(),
$this->getMockBuilder(StreamFactoryInterface::class)->getMock()
);
$client = $factory->createClient();
$this->assertInstanceOf(HttplugClient::class, $client);