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
c020cec4
Commit
c020cec4
authored
Jul 20, 2017
by
Pascal Luna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly handle the ControllerResolverInterface::getArguments deprecation in tests
parent
74d9869d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
tests/Silex/Tests/ControllerResolverTest.php
tests/Silex/Tests/ControllerResolverTest.php
+5
-0
tests/Silex/Tests/ServiceControllerResolverTest.php
tests/Silex/Tests/ServiceControllerResolverTest.php
+8
-0
No files found.
tests/Silex/Tests/ControllerResolverTest.php
View file @
c020cec4
...
...
@@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase;
use
Silex\ControllerResolver
;
use
Silex\Application
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpKernel\Kernel
;
/**
* ControllerResolver test cases.
...
...
@@ -28,6 +29,10 @@ class ControllerResolverTest extends TestCase
*/
public
function
testGetArguments
()
{
if
(
Kernel
::
VERSION_ID
>=
30100
)
{
self
::
markTestSkipped
(
'HttpKernel < 3.1.0 is required'
);
}
$app
=
new
Application
();
$resolver
=
new
ControllerResolver
(
$app
);
...
...
tests/Silex/Tests/ServiceControllerResolverTest.php
View file @
c020cec4
...
...
@@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase;
use
Silex\ServiceControllerResolver
;
use
Silex\Application
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpKernel\Kernel
;
/**
* Unit tests for ServiceControllerResolver, see ServiceControllerResolverRouterTest for some
...
...
@@ -77,8 +78,15 @@ class ServiceControllerResolverTest extends Testcase
$this
->
assertEquals
(
123
,
$this
->
resolver
->
getController
(
$req
));
}
/**
* @group legacy
*/
public
function
testShouldDelegateGetArguments
()
{
if
(
Kernel
::
VERSION_ID
>=
40000
)
{
self
::
markTestSkipped
(
'HttpKernel < 4.0 is required'
);
}
$req
=
Request
::
create
(
'/'
);
$this
->
mockResolver
->
expects
(
$this
->
once
())
->
method
(
'getArguments'
)
...
...
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