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: Remove unused imports warnings
Date: 3 years 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);
    }
}


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