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
ce634a46
Commit
ce634a46
authored
Mar 25, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no longer expose the ControllerCollection, just provide flushControllerCollection() instead
parent
a29f5770
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
28 deletions
+10
-28
src/Silex/Application.php
src/Silex/Application.php
+8
-10
tests/Silex/Tests/ApplicationTest.php
tests/Silex/Tests/ApplicationTest.php
+1
-17
tests/Silex/Tests/FunctionalTest.php
tests/Silex/Tests/FunctionalTest.php
+1
-1
No files found.
src/Silex/Application.php
View file @
ce634a46
...
...
@@ -77,16 +77,6 @@ class Application extends HttpKernel implements EventSubscriberInterface
return
$this
->
routeCollection
;
}
/**
* Get the collection of controllers.
*
* @return Silex\ControllerCollection
*/
public
function
getControllerCollection
()
{
return
$this
->
controllerCollection
;
}
/**
* Map a pattern to a callable.
*
...
...
@@ -235,6 +225,14 @@ class Application extends HttpKernel implements EventSubscriberInterface
return
$this
;
}
/**
* Flush the controller collection
*/
public
function
flushControllerCollection
()
{
$this
->
controllerCollection
->
flush
();
}
/**
* Handle the request and deliver the response.
*
...
...
tests/Silex/Tests/ApplicationTest.php
View file @
ce634a46
...
...
@@ -94,23 +94,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$routeCollection
=
$application
->
getRouteCollection
();
$this
->
assertInstanceOf
(
'Symfony\Component\Routing\RouteCollection'
,
$routeCollection
);
$this
->
assertEquals
(
0
,
count
(
$routeCollection
->
all
()));
$application
->
getControllerCollection
()
->
flush
();
$application
->
flushControllerCollection
();
$this
->
assertEquals
(
2
,
count
(
$routeCollection
->
all
()));
}
public
function
testGetControllerCollection
()
{
$application
=
new
Application
();
$application
->
get
(
'/foo'
,
function
()
{
return
'foo'
;
});
$application
->
get
(
'/bar'
,
function
()
{
return
'bar'
;
});
$controllerCollection
=
$application
->
getControllerCollection
();
$this
->
assertInstanceOf
(
'Silex\ControllerCollection'
,
$controllerCollection
);
}
}
tests/Silex/Tests/FunctionalTest.php
View file @
ce634a46
...
...
@@ -34,7 +34,7 @@ class FunctionalTest extends \PHPUnit_Framework_TestCase
})
->
setRouteName
(
'foo_abc'
);
$application
->
getControllerCollection
()
->
flush
();
$application
->
flushControllerCollection
();
$routeCollection
=
$application
->
getRouteCollection
();
$this
->
assertInstanceOf
(
'Symfony\Component\Routing\Route'
,
$routeCollection
->
get
(
'homepage'
));
$this
->
assertInstanceOf
(
'Symfony\Component\Routing\Route'
,
$routeCollection
->
get
(
'foo_abc'
));
...
...
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