Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
06b28886
Commit
06b28886
authored
Apr 16, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ControllerCollection::all()
parent
f99f6ef7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
src/Silex/ControllerCollection.php
src/Silex/ControllerCollection.php
+10
-0
tests/Silex/Tests/ControllerCollectionTest.php
tests/Silex/Tests/ControllerCollectionTest.php
+9
-0
No files found.
src/Silex/ControllerCollection.php
View file @
06b28886
...
...
@@ -54,4 +54,14 @@ class ControllerCollection
$this
->
controllers
=
array
();
}
/**
* Gets all controllers.
*
* @return array An array of Controllers
*/
public
function
all
()
{
return
$this
->
controllers
;
}
}
tests/Silex/Tests/ControllerCollectionTest.php
View file @
06b28886
...
...
@@ -49,6 +49,15 @@ class ControllerCollectionTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
2
,
count
(
$routes
->
all
()));
}
public
function
testAll
()
{
$controllers
=
new
ControllerCollection
(
new
RouteCollection
());
$controllers
->
add
(
$c1
=
new
Controller
(
new
Route
(
'/foo'
)));
$controllers
->
add
(
$c2
=
new
Controller
(
new
Route
(
'/bar'
)));
$this
->
assertEquals
(
array
(
$c1
,
$c2
),
$controllers
->
all
());
}
public
function
testControllerFreezing
()
{
$routes
=
new
RouteCollection
();
...
...
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