Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 629b399

Browse files
committed
Merge pull request #174 from symfony-cmf/improve_setup
Improve Travis setup and add symfony 3 compatibility
2 parents 433da76 + 802cfcc commit 629b399

File tree

7 files changed

+27
-34
lines changed

7 files changed

+27
-34
lines changed

.travis.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,24 @@ cache:
1212
directories:
1313
- $HOME/.composer/cache/files
1414

15-
env:
16-
- SYMFONY_VERSION=2.7.* SYMFONY_DEPRECATIONS_HELPER=weak
15+
env: SYMFONY_VERSION=2.8.*
1716

1817
matrix:
1918
include:
19+
- php: 7.0
20+
env: DEPS=dev SYMFONY_VERSION=3.1.*
2021
- php: 5.5
21-
env: SYMFONY_VERSION=2.3.* COMPOSER_FLAGS="--prefer-lowest"
22-
- php: 5.6
23-
env: SYMFONY_VERSION=2.3.* SYMFONY_DEPRECATIONS_HELPER=weak
24-
- php: 5.6
25-
env: SYMFONY_VERSION=2.8.*
26-
- php: 5.6
27-
env: SYMFONY_VERSION=3.0.*
28-
allow_failures:
29-
- env: SYMFONY_VERSION=2.8.*
30-
- env: SYMFONY_VERSION=3.0.*
22+
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_DEPRECATIONS_HELPER=weak
23+
- php: 7.0
24+
env: DEPS=dev COMPOSER_FLAGS="--prefer-stable" SYMFONY_VERSION=3.0.*
3125
fast_finish: true
3226

3327
before_install:
34-
- if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
28+
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
29+
- phpenv config-rm xdebug.ini || true
3530
- composer selfupdate
36-
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
31+
- if [ "$DEPS" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi
32+
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi
3733

3834
install: composer update $COMPOSER_FLAGS --prefer-dist
3935

Adapter/PhpcrOdmAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function createAutoRoute(UriContext $uriContext, $contentDocument, $autoR
160160
$headRoute = new $this->autoRouteFqcn();
161161
$headRoute->setContent($contentDocument);
162162
$headRoute->setName($headName);
163-
$headRoute->setParent($document);
163+
$headRoute->setParentDocument($document);
164164
$headRoute->setAutoRouteTag($autoRouteTag);
165165
$headRoute->setType(AutoRouteInterface::TYPE_PRIMARY);
166166

Resources/config/auto_route.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@
8787
</service>
8888

8989
<service id="cmf_routing_auto.metadata.factory"
90-
class="%cmf_routing_auto.metadata.factory.class%"
91-
factory-service="cmf_routing_auto.metadata.factory.builder"
92-
factory-method="getMetadataFactory" />
90+
class="%cmf_routing_auto.metadata.factory.class%">
91+
<factory service="cmf_routing_auto.metadata.factory.builder" method="getMetadataFactory" />
92+
</service>
9393

9494
<!-- Controller -->
9595
<service

Tests/Functional/EventListener/AutoRouteListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public function testLeaveRedirectChildrenMigrations()
467467
$parentRoute = $this->getDm()->find(null, '/test/auto-route/seo-articles/hai');
468468
$childRoute = new AutoRoute();
469469
$childRoute->setName('foo');
470-
$childRoute->setParent($parentRoute);
470+
$childRoute->setParentDocument($parentRoute);
471471
$this->getDm()->persist($childRoute);
472472
$this->getDm()->flush();
473473

Tests/Resources/app/config/app_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cmf_routing:
1010
persistence:
1111
phpcr:
1212
enabled: true
13-
route_basepath: /test/auto-route
13+
route_basepaths: [/test/auto-route]
1414

1515
cmf_routing_auto:
1616
auto_mapping: false
@@ -19,4 +19,4 @@ cmf_routing_auto:
1919
route_basepath: /test/auto-route
2020
mapping:
2121
resources:
22-
- @CmfRoutingAutoBundle/Tests/Resources/app/config/routing_auto.yml
22+
- '@CmfRoutingAutoBundle/Tests/Resources/app/config/routing_auto.yml'

Tests/Unit/Adapter/PhpcrOdmAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testCreateAutoRoute($path, $expectedParentPath, $expectedName, $
123123
$this->assertInstanceOf('Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRoute', $res);
124124
$this->assertEquals($expectedName, $res->getName());
125125

126-
$this->assertSame($this->parentRoute, $res->getParent());
126+
$this->assertSame($this->parentRoute, $res->getParentDocument());
127127
$this->assertSame($this->contentDocument, $res->getContent());
128128
}
129129

@@ -158,7 +158,7 @@ public function testCreateAutoRouteSetDefaults()
158158
'two' => 'k2',
159159
), $res->getDefaults());
160160

161-
$this->assertSame($this->parentRoute, $res->getParent());
161+
$this->assertSame($this->parentRoute, $res->getParentDocument());
162162
$this->assertSame($this->contentDocument, $res->getContent());
163163
}
164164

composer.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,25 @@
66
"authors": [
77
{
88
"name": "Symfony CMF Community",
9-
"homepage": "https://github.com/symfony-cmf/symfony-cmf/contributors"
9+
"homepage": "https://github.com/symfony-cmf/routing-auto-bundle/contributors"
1010
}
1111
],
12-
"minimum-stability": "dev",
13-
"prefer-stable": true,
1412
"require": {
15-
"php": "^5.5.0|^7.0",
13+
"php": "^5.5.9|^7.0",
14+
"symfony/framework-bundle": "^2.8|^3.0",
15+
"symfony/config": "^2.8|^3.0",
1616
"symfony-cmf/routing-auto": "^2.0@dev",
17-
"symfony-cmf/routing-bundle": "^1.2.0",
17+
"symfony-cmf/routing-bundle": "^1.2.0|^2.0",
1818
"symfony-cmf/slugifier-api": "^1.0",
1919
"aferrandini/urlizer": "1.0.*",
20-
"symfony/config": "^2.2",
2120
"jms/metadata": "1.5.*"
2221
},
2322
"require-dev": {
2423
"symfony-cmf/testing": "^1.3",
25-
"symfony/yaml": "^2.1",
24+
"symfony/yaml": "^2.8|^3.0",
2625
"matthiasnoback/symfony-dependency-injection-test": "~0.6",
27-
"matthiasnoback/symfony-config-test": "0.*",
28-
"doctrine/phpcr-odm": "^1.3",
29-
"phpunit/phpunit": "^4.5",
30-
"symfony/phpunit-bridge": "^2.7"
26+
"matthiasnoback/symfony-config-test": "^1.3.1",
27+
"doctrine/phpcr-odm": "^1.3"
3128
},
3229
"suggest": {
3330
"doctrine/phpcr-odm": "To enable support for the PHPCR ODM documents",

0 commit comments

Comments
 (0)