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: Test enhancement
Date: 1 year 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);
    }
}


For more information send a message to info at phpclasses dot org.