Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
4c2209e3
Commit
4c2209e3
authored
Oct 27, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added url tests.
parent
4d7457ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
UrlTest.php
tests/Cases/UrlTest.php
+49
-0
No files found.
tests/Cases/UrlTest.php
0 → 100644
View file @
4c2209e3
<?php
use
Laravel\URL
,
Laravel\Config
;
class
UrlTest
extends
PHPUnit_Framework_TestCase
{
public
function
test_simple_url
()
{
$this
->
assertEquals
(
URL
::
to
(
''
),
'http://localhost/index.php/'
);
$this
->
assertEquals
(
URL
::
to
(
'something'
),
'http://localhost/index.php/something'
);
}
public
function
test_simple_url_without_index
()
{
Config
::
set
(
'application.index'
,
''
);
$this
->
assertEquals
(
Url
::
to
(
''
),
'http://localhost/'
);
$this
->
assertEquals
(
Url
::
to
(
'something'
),
'http://localhost/something'
);
Config
::
set
(
'application.index'
,
'index.php'
);
}
public
function
test_asset_url
()
{
$this
->
assertEquals
(
URL
::
to_asset
(
'img/test.jpg'
),
'http://localhost/img/test.jpg'
);
Config
::
set
(
'application.index'
,
''
);
$this
->
assertEquals
(
URL
::
to_asset
(
'img/test.jpg'
),
'http://localhost/img/test.jpg'
);
Config
::
set
(
'application.index'
,
'index.php'
);
}
public
function
test_secure_url
()
{
$this
->
assertEquals
(
URL
::
to_secure
(
'something'
),
'https://localhost/index.php/something'
);
Config
::
set
(
'application.ssl'
,
false
);
$this
->
assertEquals
(
URL
::
to_secure
(
'something'
),
'http://localhost/index.php/something'
);
Config
::
set
(
'application.ssl'
,
true
);
}
public
function
test_slug
()
{
$this
->
assertEquals
(
URL
::
slug
(
'My favorite blog!!'
),
'my-favorite-blog'
);
$this
->
assertEquals
(
URL
::
slug
(
'My favorite blog!!'
,
'_'
),
'my_favorite_blog'
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment