PHP Classes

File: tests/http-tests/HttpClientFactoryTest.php

Recommend this page to a friend!
  Classes of Maik Greubel   PHP Generics   tests/http-tests/HttpClientFactoryTest.php   Download  
File: tests/http-tests/HttpClientFactoryTest.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Generics
Framework for accessing streams, sockets and logs
Author: By
Last change: Update of tests/http-tests/HttpClientFactoryTest.php
Date: 1 month ago
Size: 686 bytes
 

Contents

Class file image Download
<?php
namespace Generics\Tests;

use
PHPUnit\Framework\TestCase;
use
Generics\Util\UrlParser;
use
Generics\Client\HttpClientFactory;
use
Generics\Client\HttpClient;
use
Generics\Client\HttpsClient;

class
HttpClientFactoryTest extends TestCase
{
    public function
testHttpFactory()
    {
       
$url = UrlParser::parseUrl("http://httpbin.org");
       
$client = HttpClientFactory::get($url);
       
$this->assertInstanceOf(HttpClient::class, $client);
    }

    public function
testHttpsFactory()
    {
       
$url = UrlParser::parseUrl("https://httpbin.org");
       
$client = HttpClientFactory::get($url);
       
$this->assertInstanceOf(HttpsClient::class, $client);
    }
}