Skip to content

Symfony3 compatibility #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ sudo: false
cache:
directories:
- $HOME/.composer/cache/files

env:
global:
- SYMFONY_DEPRECATIONS_HELPER=322

matrix:
include:
- php: 5.6
env: DEPS=dev
env: DEPS=dev SYMFONY_VERSION=2.8.*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I do one last try? :)

DEPS=dev SYMFONY_VERSION="3.0.x-dev as 2.8.x-dev"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or i just merge and we can do further PRs

- php: 5.3
env: COMPOSER_FLAGS="--prefer-lowest"
- php: 5.6
env: SYMFONY_VERSION=2.3.*
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.7.*
- php: 5.6
env: SYMFONY_VERSION=2.7.*
fast_finish: true
Expand All @@ -36,7 +34,7 @@ before_install:
- composer self-update
- if [ "$DEPS" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi

install: composer update --prefer-dist $COMPOSER_FLAGS

before_script: vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh
Expand Down
2 changes: 1 addition & 1 deletion Admin/RedirectRouteAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->with('form.group_general')
->add('parent', Sf2CompatUtil::getFormTypeName('doctrine_phpcr_odm_tree'), array('choice_list' => array(), 'select_root_node' => true, 'root_node' => $this->routeRoot))
->add('parentDocument', Sf2CompatUtil::getFormTypeName('doctrine_phpcr_odm_tree'), array('choice_list' => array(), 'select_root_node' => true, 'root_node' => $this->routeRoot))
->add('name', Sf2CompatUtil::getFormTypeName('text'))
->add('routeName', Sf2CompatUtil::getFormTypeName('text'), array('required' => false))
->add('uri', Sf2CompatUtil::getFormTypeName('text'), array('required' => false))
Expand Down
4 changes: 2 additions & 2 deletions Admin/RouteAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function configureFormFields(FormMapper $formMapper)
'translation_domain' => 'CmfRoutingBundle',
))
->add(
'parent',
'parentDocument',
Sf2CompatUtil::getFormTypeName('doctrine_phpcr_odm_tree'),
array('choice_list' => array(), 'select_root_node' => true, 'root_node' => $this->routeRoot)
)
Expand Down Expand Up @@ -146,7 +146,7 @@ protected function configureFieldsForDefaults($dynamicDefaults)
'_controller' => array('_controller', Sf2CompatUtil::getFormTypeName('text'), array('required' => false)),
'_template' => array('_template', Sf2CompatUtil::getFormTypeName('text'), array('required' => false)),
'type' => array('type', Sf2CompatUtil::getFormTypeName('cmf_routing_route_type'), array(
'empty_value' => '',
'placeholder' => '',
'required' => false,
)),
);
Expand Down
4 changes: 2 additions & 2 deletions Model/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function getOption($name)
return 'Symfony\\Component\\Routing\\RouteCompiler';
}
if ($this->isBooleanOption($name)) {
return (boolean) $option;
return (bool) $option;
}

return $option;
Expand All @@ -202,7 +202,7 @@ public function getOptions()
}
foreach ($options as $key => $value) {
if ($this->isBooleanOption($key)) {
$options[$key] = (boolean) $value;
$options[$key] = (bool) $value;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/Resources/app/config/cmf_routing.phpcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ cmf_routing:
persistence:
phpcr:
enabled: true
route_basepath: /test/routing
route_basepaths: /test/routing
5 changes: 5 additions & 0 deletions Tests/Unit/Routing/DynamicRouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ private function assertRequestAttributes($request)
$this->assertEquals('template', $request->attributes->get(DynamicRouter::CONTENT_TEMPLATE));
}

/**
* @group legacy
*/
public function testMatch()
{
$this->eventDispatcher->expects($this->once())
Expand Down Expand Up @@ -86,6 +89,8 @@ public function testMatchRequest()

/**
* @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException
*
* @group legacy
*/
public function testMatchNoRequest()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/WebTest/RedirectRouteAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testRedirectRouteCreate()
$actionUrl = $node->getAttribute('action');
$uniqId = substr(strstr($actionUrl, '='), 1);

$form[$uniqId.'[parent]'] = '/test/routing';
$form[$uniqId.'[parentDocument]'] = '/test/routing';
$form[$uniqId.'[name]'] = 'foo-test';

$this->client->submit($form);
Expand Down
2 changes: 1 addition & 1 deletion Tests/WebTest/RouteAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testRouteCreate()
$actionUrl = $node->getAttribute('action');
$uniqId = substr(strstr($actionUrl, '='), 1);

$form[$uniqId.'[parent]'] = '/test/routing';
$form[$uniqId.'[parentDocument]'] = '/test/routing';
$form[$uniqId.'[name]'] = 'foo-test';

$this->client->submit($form);
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"php": "^5.3.9|^7.0",
"symfony-cmf/routing": "~1.2",
"symfony/framework-bundle": "~2.3"
"symfony/framework-bundle": "~2.7|~3.0"
},
"require-dev": {
"symfony-cmf/core-bundle": "~1.1",
Expand All @@ -23,7 +23,10 @@
"matthiasnoback/symfony-dependency-injection-test": "~0.6",
"matthiasnoback/symfony-config-test": "^1.3.1",
"phpunit/php-code-coverage": "@stable",
"sonata-project/doctrine-phpcr-admin-bundle": "^1.1",
"sonata-project/admin-bundle": "^2.2.12",
"sonata-project/core-bundle": "^2.2.3",
"sonata-project/block-bundle": "^2.2.8",
"sonata-project/doctrine-phpcr-admin-bundle": "^1.2.3",
"symfony/monolog-bundle": "~2.3",
"doctrine/orm": "~2.3",
"doctrine/data-fixtures": "^1.0.0-alpha3"
Expand Down