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
0356873a
Commit
0356873a
authored
May 20, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed Controller::generateRouteName() visibility
parent
31652440
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
src/Silex/Controller.php
src/Silex/Controller.php
+1
-1
tests/Silex/Tests/ControllerCollectionTest.php
tests/Silex/Tests/ControllerCollectionTest.php
+4
-1
tests/Silex/Tests/ControllerTest.php
tests/Silex/Tests/ControllerTest.php
+4
-1
No files found.
src/Silex/Controller.php
View file @
0356873a
...
...
@@ -186,7 +186,7 @@ class Controller
$this
->
isFrozen
=
true
;
}
p
ublic
function
generateRouteName
(
$prefix
)
p
rotected
function
generateRouteName
(
$prefix
)
{
$requirements
=
$this
->
route
->
getRequirements
();
$method
=
isset
(
$requirements
[
'_method'
])
?
$requirements
[
'_method'
]
:
''
;
...
...
tests/Silex/Tests/ControllerCollectionTest.php
View file @
0356873a
...
...
@@ -76,7 +76,10 @@ class ControllerCollectionTest extends \PHPUnit_Framework_TestCase
$controllers
->
add
(
$mountedRootController
);
$mainRootController
=
new
Controller
(
new
Route
(
'/'
));
$mainRootController
->
bind
(
$mainRootController
->
generateRouteName
(
'main_'
));
$r
=
new
\ReflectionObject
(
$mainRootController
);
$m
=
$r
->
getMethod
(
'generateRouteName'
);
$m
->
setAccessible
(
true
);
$mainRootController
->
bind
(
$m
->
invoke
(
$mainRootController
,
'main_'
));
$controllers
->
flush
();
...
...
tests/Silex/Tests/ControllerTest.php
View file @
0356873a
...
...
@@ -75,7 +75,10 @@ class ControllerTest extends \PHPUnit_Framework_TestCase
public
function
testDefaultRouteNameGeneration
(
Route
$route
,
$expectedRouteName
)
{
$controller
=
new
Controller
(
$route
);
$controller
->
bind
(
$controller
->
generateRouteName
(
''
));
$r
=
new
\ReflectionObject
(
$controller
);
$m
=
$r
->
getMethod
(
'generateRouteName'
);
$m
->
setAccessible
(
true
);
$controller
->
bind
(
$m
->
invoke
(
$controller
,
''
));
$this
->
assertEquals
(
$expectedRouteName
,
$controller
->
getRouteName
());
}
...
...
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