PHP Classes

File: tests/socket-tests/UrlTest.php

Recommend this page to a friend!
  Classes of Maik Greubel   PHP Generics   tests/socket-tests/UrlTest.php   Download  
File: tests/socket-tests/UrlTest.php
Role: Unit test script
Content type: text/plain
Description: Url class test
Class: PHP Generics
Framework for accessing streams, sockets and logs
Author: By
Last change: Update of tests/socket-tests/UrlTest.php
Date: 2 months ago
Size: 756 bytes
 

Contents

Class file image Download
<?php

namespace Generics\Tests;

use
Generics\Socket\Url;

class
UrlTest extends \PHPUnit\Framework\TestCase
{
    public function
testUrlSimple()
    {
       
$u = "http://www.nkey.de/";
       
$url = new Url($u);
       
$this->assertEquals($u, strval($url));
    }

    public function
testUrlHttps()
    {
       
$u = "https://www.nkey.de/";
       
$url = new Url($u);
       
$this->assertEquals($u, strval($url));
    }

    public function
testUrlFtp()
    {
       
$u = "ftp://www.nkey.de/";
       
$url = new Url($u);
       
$this->assertEquals($u, strval($url));
    }

    public function
testUrlWithPort()
    {
       
$u = "http://www.nkey.de:8080/";
       
$url = new Url($u);
       
$this->assertEquals($u, strval($url));
    }
}