File tree Expand file tree Collapse file tree 4 files changed +34
-5
lines changed
Tests/DependencyInjection Expand file tree Collapse file tree 4 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 4
4
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
5
xsi : schemaLocation =" http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd" >
6
6
7
- <route id =" fos_oauth_server_authorize" pattern =" /oauth/v2/auth" >
7
+ <route id =" fos_oauth_server_authorize" path =" /oauth/v2/auth" methods = " GET POST " >
8
8
<default key =" _controller" >FOSOAuthServerBundle:Authorize:authorize</default >
9
- <requirement key =" _method" >GET|POST</requirement >
10
9
</route >
11
10
12
11
</routes >
Original file line number Diff line number Diff line change 4
4
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
5
xsi : schemaLocation =" http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd" >
6
6
7
- <route id =" fos_oauth_server_token" pattern =" /oauth/v2/token" >
7
+ <route id =" fos_oauth_server_token" path =" /oauth/v2/token" methods = " GET POST " >
8
8
<default key =" _controller" >fos_oauth_server.controller.token:tokenAction</default >
9
- <requirement key =" _method" >GET|POST</requirement >
10
9
</route >
11
10
12
11
</routes >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace DependencyInjection ;
4
+
5
+ use Symfony \Component \Config \FileLocator ;
6
+ use Symfony \Component \Routing \Loader \XmlFileLoader ;
7
+
8
+ class FOSOAuthServerExtensionTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ public function testLoadAuthorizeRouting ()
11
+ {
12
+ $ locator = new FileLocator ();
13
+ $ loader = new XmlFileLoader ($ locator );
14
+
15
+ $ collection = $ loader ->load (__DIR__ .'/../../Resources/config/routing/authorize.xml ' );
16
+ $ authorizeRoute = $ collection ->get ('fos_oauth_server_authorize ' );
17
+ $ this ->assertEquals ('/oauth/v2/auth ' , $ authorizeRoute ->getPath ());
18
+ $ this ->assertEquals (array ('GET ' , 'POST ' ), $ authorizeRoute ->getMethods ());
19
+ }
20
+
21
+ public function testLoadTokenRouting ()
22
+ {
23
+ $ locator = new FileLocator ();
24
+ $ loader = new XmlFileLoader ($ locator );
25
+
26
+ $ collection = $ loader ->load (__DIR__ .'/../../Resources/config/routing/token.xml ' );
27
+ $ tokenRoute = $ collection ->get ('fos_oauth_server_token ' );
28
+ $ this ->assertEquals ('/oauth/v2/token ' , $ tokenRoute ->getPath ());
29
+ $ this ->assertEquals (array ('GET ' , 'POST ' ), $ tokenRoute ->getMethods ());
30
+ }
31
+ }
Original file line number Diff line number Diff line change 18
18
"require" : {
19
19
"php" : " >=5.3.3" ,
20
20
"friendsofsymfony/oauth2-php" : " ~1.1.0" ,
21
- "symfony/framework-bundle" : " ~2.1 " ,
21
+ "symfony/framework-bundle" : " ~2.2 " ,
22
22
"symfony/security-bundle" : " ~2.1"
23
23
},
24
24
"require-dev" : {
You can’t perform that action at this time.
0 commit comments