-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New method added to get the base url
- Loading branch information
1 parent
7c0a70e
commit b1bd1a7
Showing
4 changed files
with
63 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?php | ||
<?php | ||
/** | ||
* Library for urls manipulation. | ||
* | ||
* @author Josantonius - [email protected] | ||
* @copyright Copyright (c) 2017 JST PHP Framework | ||
* @license https://opensource.org/licenses/MIT - The MIT License (MIT) | ||
* @link https://github.com/Josantonius/PHP-Url | ||
* @since File available since 1.0.0 - Update: 2017-02-14 | ||
* @since 1.0.0 | ||
*/ | ||
|
||
namespace Josantonius\Url\Tests; | ||
|
@@ -27,7 +27,17 @@ class UrlTest { | |
*/ | ||
public static function testGetCurrentPage() { | ||
|
||
echo '<pre>'; var_dump(Url::getCurrentPage()); echo '</pre>'; | ||
echo '<pre>'; var_dump(Url::getCurrentPage()); echo '</pre>'; | ||
} | ||
|
||
/** | ||
* Get base url of the site. | ||
* | ||
* @since 1.0.0 | ||
*/ | ||
public static function testGetBaseUrl() { | ||
|
||
echo '<pre>'; var_dump(Url::getBaseUrl()); echo '</pre>'; | ||
} | ||
|
||
/** | ||
|
@@ -37,7 +47,7 @@ public static function testGetCurrentPage() { | |
*/ | ||
public static function testGetProtocol() { | ||
|
||
echo '<pre>'; var_dump(Url::getProtocol()); echo '</pre>'; | ||
echo '<pre>'; var_dump(Url::getProtocol()); echo '</pre>'; | ||
} | ||
|
||
/** | ||
|
@@ -47,7 +57,7 @@ public static function testGetProtocol() { | |
*/ | ||
public static function testIsSSL() { | ||
|
||
echo '<pre>'; var_dump(Url::isSSL()); echo '</pre>'; | ||
echo '<pre>'; var_dump(Url::isSSL()); echo '</pre>'; | ||
} | ||
|
||
/** | ||
|
@@ -57,7 +67,7 @@ public static function testIsSSL() { | |
*/ | ||
public static function getDomain() { | ||
|
||
echo '<pre>'; var_dump(Url::testGetProtocol()); echo '</pre>'; | ||
echo '<pre>'; var_dump(Url::testGetProtocol()); echo '</pre>'; | ||
} | ||
|
||
/** | ||
|
@@ -67,7 +77,7 @@ public static function getDomain() { | |
*/ | ||
public static function testGetUri() { | ||
|
||
echo '<pre>'; var_dump(Url::getUri()); echo '</pre>'; | ||
echo '<pre>'; var_dump(Url::getUri()); echo '</pre>'; | ||
} | ||
|
||
/** | ||
|
@@ -87,7 +97,7 @@ public static function testGetUriMethods() { | |
*/ | ||
public static function testGetPort() { | ||
|
||
echo '<pre>'; var_dump(Url::getPort()); echo '</pre>'; | ||
echo '<pre>'; var_dump(Url::getPort()); echo '</pre>'; | ||
} | ||
|
||
/** | ||
|
@@ -97,7 +107,7 @@ public static function testGetPort() { | |
*/ | ||
public static function testAddBackslash() { | ||
|
||
echo '<pre>'; var_dump(Url::addBackslash('path/to')); echo '</pre>'; | ||
echo '<pre>'; var_dump(Url::addBackslash('path/to')); echo '</pre>'; | ||
} | ||
|
||
/** | ||
|
@@ -107,7 +117,7 @@ public static function testAddBackslash() { | |
*/ | ||
public static function testPrevious() { | ||
|
||
Url::previous(); | ||
Url::previous(); | ||
} | ||
|
||
/** | ||
|
@@ -172,7 +182,7 @@ public static function testSegment() { | |
*/ | ||
public static function testGetFirstSegment() { | ||
|
||
$segments = Url::segment('path/to/panel/user'); | ||
$segments = Url::segment('path/to/panel/user'); | ||
|
||
echo '<pre>'; var_dump(Url::getFirstSegment($segments)); echo '</pre>'; | ||
} | ||
|
@@ -184,8 +194,8 @@ public static function testGetFirstSegment() { | |
*/ | ||
public static function testGetLastSegment() { | ||
|
||
$segments = Url::segment('path/to/panel/user'); | ||
$segments = Url::segment('path/to/panel/user'); | ||
|
||
echo '<pre>'; var_dump(Url::getLastSegment($segments)); echo '</pre>'; | ||
} | ||
} | ||
} |