Skip to content
This repository has been archived by the owner on Sep 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #211 from KnpLabs/sf2.7
Browse files Browse the repository at this point in the history
Allowed Symfony 2.7 version
  • Loading branch information
gquemener committed Sep 7, 2015
2 parents 69aefbd + e38c247 commit 3484f68
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ matrix:
fast_finish: true
allow_failures:
- php: hhvm
- env: SYMFONY_VERSION='2.7.*@dev'
- env: SYMFONY_VERSION='2.8.*@dev'
- php: 7.0
include:
- php: 5.4
Expand All @@ -16,15 +16,17 @@ matrix:
- php: 5.4
env: SYMFONY_VERSION='2.6.*'
- php: 5.4
env: SYMFONY_VERSION='2.7.*@dev'
env: SYMFONY_VERSION='2.7.*'
- php: 5.4
env: SYMFONY_VERSION='2.8.*@dev'

before_script:
- composer selfupdate
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony=$SYMFONY_VERSION; else composer install; fi;
- phantomjs --version
- phantomjs --webdriver=4444 &
- php -S localhost:8080 -t features/Context/fixtures &

script:
- ./bin/phpspec run -fpretty
- ./bin/behat --verbose
5 changes: 4 additions & 1 deletion Routing/Loader/ConventionalLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConventionalLoader extends YamlFileLoader
'prefix', 'defaults', 'requirements', 'options', 'collections', 'resources'
);
private static $supportedActionKeys = array(
'pattern', 'defaults', 'requirements', 'options'
'pattern', 'defaults', 'requirements', 'options', 'methods'
);
private $yaml;

Expand Down Expand Up @@ -370,6 +370,9 @@ private function overrideRouteParams($shortname, Route $route, $params)
if (isset($params['options'])) {
$route->setOptions($params['options']);
}
if (isset($params['methods'])) {
$route->setMethods($params['methods']);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": ">=5.4",
"symfony/symfony": "~2.4,<2.7",
"symfony/symfony": "~2.4",
"nelmio/alice": "~1.5",
"fzaninotto/faker": "~1.2"
},
Expand Down
4 changes: 2 additions & 2 deletions features/csrf_protection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Feature: CSRF protection for unsafe requests
App:Foo:show: ~
App:Foo:delete:
defaults: { _check_csrf: true }
requirements: { method: delete }
methods: GET|DELETE
App:Foo:deleteUnsafe:
defaults: { _check_csrf: false, _controller: App:Foo:delete }
requirements: { method: delete }
methods: DELETE
"""
And I write in "App/Resources/views/Foo/show.html.twig":
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ function it_should_throw_exception_if_unsupported_action_route_param_provided($y
));

$this->shouldThrow(new InvalidArgumentException(
'`unsopported_key` parameter is not supported by `App:Admin\Cheeses:show` action route. Use one of [pattern, defaults, requirements, options].'
'`unsopported_key` parameter is not supported by `App:Admin\Cheeses:show` action route. Use one of [pattern, defaults, requirements, options, methods].'
))->duringLoad('routing.yml');
}

Expand Down

0 comments on commit 3484f68

Please sign in to comment.