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
28ff0034
Commit
28ff0034
authored
Nov 04, 2015
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes some routing deprecation notices
parent
e6dd62a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
+3
-2
tests/Silex/Tests/Provider/UrlGeneratorServiceProviderTest.php
.../Silex/Tests/Provider/UrlGeneratorServiceProviderTest.php
+2
-1
No files found.
tests/Silex/Tests/Application/UrlGeneratorTraitTest.php
View file @
28ff0034
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
namespace
Silex\Tests\Application
;
namespace
Silex\Tests\Application
;
use
Silex\Provider\UrlGeneratorServiceProvider
;
use
Silex\Provider\UrlGeneratorServiceProvider
;
use
Symfony\Component\Routing\Generator\UrlGeneratorInterface
;
/**
/**
* UrlGeneratorTrait test cases.
* UrlGeneratorTrait test cases.
...
@@ -26,7 +27,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
...
@@ -26,7 +27,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
{
$app
=
$this
->
createApplication
();
$app
=
$this
->
createApplication
();
$app
[
'url_generator'
]
=
$translator
=
$this
->
getMockBuilder
(
'Symfony\Component\Routing\Generator\UrlGeneratorInterface'
)
->
disableOriginalConstructor
()
->
getMock
();
$app
[
'url_generator'
]
=
$translator
=
$this
->
getMockBuilder
(
'Symfony\Component\Routing\Generator\UrlGeneratorInterface'
)
->
disableOriginalConstructor
()
->
getMock
();
$translator
->
expects
(
$this
->
once
())
->
method
(
'generate'
)
->
with
(
'foo'
,
array
(),
true
);
$translator
->
expects
(
$this
->
once
())
->
method
(
'generate'
)
->
with
(
'foo'
,
array
(),
UrlGeneratorInterface
::
ABSOLUTE_URL
);
$app
->
url
(
'foo'
);
$app
->
url
(
'foo'
);
}
}
...
@@ -34,7 +35,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
...
@@ -34,7 +35,7 @@ class UrlGeneratorTraitTest extends \PHPUnit_Framework_TestCase
{
{
$app
=
$this
->
createApplication
();
$app
=
$this
->
createApplication
();
$app
[
'url_generator'
]
=
$translator
=
$this
->
getMockBuilder
(
'Symfony\Component\Routing\Generator\UrlGeneratorInterface'
)
->
disableOriginalConstructor
()
->
getMock
();
$app
[
'url_generator'
]
=
$translator
=
$this
->
getMockBuilder
(
'Symfony\Component\Routing\Generator\UrlGeneratorInterface'
)
->
disableOriginalConstructor
()
->
getMock
();
$translator
->
expects
(
$this
->
once
())
->
method
(
'generate'
)
->
with
(
'foo'
,
array
(),
false
);
$translator
->
expects
(
$this
->
once
())
->
method
(
'generate'
)
->
with
(
'foo'
,
array
(),
UrlGeneratorInterface
::
ABSOLUTE_PATH
);
$app
->
path
(
'foo'
);
$app
->
path
(
'foo'
);
}
}
...
...
tests/Silex/Tests/Provider/UrlGeneratorServiceProviderTest.php
View file @
28ff0034
...
@@ -14,6 +14,7 @@ namespace Silex\Tests\Provider;
...
@@ -14,6 +14,7 @@ namespace Silex\Tests\Provider;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\Provider\UrlGeneratorServiceProvider
;
use
Silex\Provider\UrlGeneratorServiceProvider
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\Routing\Generator\UrlGeneratorInterface
;
/**
/**
* UrlGeneratorProvider test cases.
* UrlGeneratorProvider test cases.
...
@@ -68,7 +69,7 @@ class UrlGeneratorServiceProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -68,7 +69,7 @@ class UrlGeneratorServiceProviderTest extends \PHPUnit_Framework_TestCase
->
bind
(
'hello'
);
->
bind
(
'hello'
);
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
$app
->
get
(
'/'
,
function
()
use
(
$app
)
{
return
$app
[
'url_generator'
]
->
generate
(
'hello'
,
array
(
'name'
=>
'john'
),
true
);
return
$app
[
'url_generator'
]
->
generate
(
'hello'
,
array
(
'name'
=>
'john'
),
UrlGeneratorInterface
::
ABSOLUTE_URL
);
});
});
$request
=
Request
::
create
(
'https://localhost:81/'
);
$request
=
Request
::
create
(
'https://localhost:81/'
);
...
...
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