PHP Classes

File: tests/util-tests/EndpointParserTest.php

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

Contents

Class file image Download
<?php

namespace Generics\Tests;

use
Generics\Util\EndpointParser;

class
EndpointParserTest extends \PHPUnit\Framework\TestCase
{
    public function
testEndpointParserHttp()
    {
       
$url = "http://www.nkey.de/index.php";

       
$endpoint = EndpointParser::parseUrl($url);

       
$this->assertEquals('www.nkey.de', $endpoint->getAddress());
       
$this->assertEquals(80, $endpoint->getPort());
    }

   
/**
     * @expectedException \Generics\Socket\InvalidUrlException
     */
   
public function testInvalidUrlException()
    {
       
$url = "htt://www.nkey.de/index.php";

       
EndpointParser::parseUrl($url);
    }
}