Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Latest commit

 

History

History
32 lines (21 loc) · 672 Bytes

README.md

File metadata and controls

32 lines (21 loc) · 672 Bytes

Installation

Simply run composer install to install phpunit.
See 'Testing' for instructions on how to execute the tests.

Usage

Usage of the class is simple:

$url = new Url('http://www.google.com')

Now you can pick out various parts of the url with the getters the class provides.

$url = new Url('http://www.google.com')

$scheme = $url->getScheme(); // http
$host = $url->getHost(); // www.google.com

Want to get the parsed URL as a string? Simply use (string)$url to get http://www.google.com

Testing

Run the following command to initiate the test

./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/UrlTest