Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
d82a3f41
Commit
d82a3f41
authored
Sep 06, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added asset dependency tests.
parent
ed9e04db
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
tests/AssetTest.php
+39
-2
No files found.
tests/AssetTest.php
View file @
d82a3f41
...
...
@@ -63,7 +63,7 @@ class AssetTest extends PHPUnit_Framework_TestCase {
);
}
public
function
test
StylesCanBeRetrieve
d
()
public
function
test
AllStylesCanBeRetrievedViaStylesMetho
d
()
{
$container
=
new
Laravel\Asset_Container
(
'default'
,
new
HTMLAssetStub
);
...
...
@@ -74,7 +74,7 @@ class AssetTest extends PHPUnit_Framework_TestCase {
$this
->
assertEquals
(
$container
->
styles
(),
'css/reset.css media:allcss/jquery.css media:all'
);
}
public
function
test
ScriptsCanBeRetrieve
d
()
public
function
test
AllScriptsCanBeRetrievedViaScriptsMetho
d
()
{
$container
=
new
Laravel\Asset_Container
(
'default'
,
new
HTMLAssetStub
);
...
...
@@ -85,6 +85,43 @@ class AssetTest extends PHPUnit_Framework_TestCase {
$this
->
assertEquals
(
$container
->
scripts
(),
'js/jquery-ui.js js/jquery.js test:value'
);
}
public
function
testAssetsAreSortedBasedOnDependencies
()
{
$container
=
$this
->
getContainer
();
$container
->
script
(
'jquery'
,
'js/jquery.js'
,
array
(
'jquery-ui'
));
$container
->
script
(
'jquery-ui'
,
'js/jquery-ui.js'
);
$scripts
=
$container
->
scripts
();
$this
->
assertTrue
(
strpos
(
$scripts
,
'js/jquery-ui.js'
)
<
strpos
(
$scripts
,
'js/jquery.js'
));
}
/**
* @expectedException Exception
*/
public
function
testAssetsCannotBeDependentOnSelf
()
{
$container
=
$this
->
getContainer
();
$container
->
script
(
'jquery'
,
'js/jquery.js'
,
array
(
'jquery'
));
$container
->
scripts
();
}
/**
* @expectedException Exception
*/
public
function
testAssetDependenciesCannotBeCircular
()
{
$container
=
$this
->
getContainer
();
$container
->
script
(
'jquery'
,
'js/jquery.js'
,
array
(
'jquery-ui'
));
$container
->
script
(
'jquery-ui'
,
'js/jquery-ui.js'
,
array
(
'jquery'
));
$container
->
scripts
();
}
private
function
getContainer
()
{
return
new
Laravel\Asset_Container
(
'default'
,
Laravel\IoC
::
resolve
(
'laravel.html'
));
...
...
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