Skip to content

Commit e089668

Browse files
authored
Merge pull request #214 from symfony-cmf/build
cleanup build matrix
2 parents a2f551b + e30518e commit e089668

File tree

7 files changed

+34
-25423
lines changed

7 files changed

+34
-25423
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@ sudo: false
1010

1111
cache:
1212
directories:
13+
- .phpunit
1314
- $HOME/.composer/cache/files
1415

1516
env:
17+
matrix: SYMFONY_VERSION=3.2.*
1618
global:
17-
- SYMFONY_DEPRECATIONS_HELPER=weak
18-
matrix:
19-
- SYMFONY_VERSION=2.8.*
19+
- SYMFONY_DEPRECATIONS_HELPER=42
20+
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
2021

2122
matrix:
2223
include:
23-
- php: 7.0
24-
env: DEPS=dev SYMFONY_VERSION=3.1.*
2524
- php: 5.5
26-
env: COMPOSER_FLAGS="--prefer-lowest"
27-
- php: 7.0
28-
env: DEPS=dev COMPOSER_FLAGS="--prefer-stable" SYMFONY_VERSION=3.0.*
25+
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak
26+
- php: 7.1
27+
env: DEPS=dev SYMFONY_VERSION=3.3.*
28+
- php: 7.1
29+
env: SYMFONY_VERSION=3.1.*
2930
fast_finish: true
3031

3132
before_install:
@@ -37,8 +38,7 @@ before_install:
3738

3839
install: composer update --prefer-dist $COMPOSER_FLAGS
3940

40-
script: phpunit
41+
script: vendor/bin/simple-phpunit
4142

4243
notifications:
4344
irc: "irc.freenode.org#symfony-cmf"
44-
email: "symfony-cmf-devs@googlegroups.com"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ translated content.
1616

1717
## Requirements
1818

19-
* Symfony 2.3+
19+
* Symfony 2.8+
2020

2121

2222
## Documentation

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,22 @@
1818
},
1919
"require-dev": {
2020
"symfony/security-bundle": "^2.8|^3.0",
21+
"symfony/phpunit-bridge": "^3.2",
2122
"mockery/mockery": "^0.9.4",
22-
"symfony-cmf/routing-bundle": "^1.2|^2.0",
23+
"symfony-cmf/routing-bundle": "^2.0",
2324
"symfony-cmf/testing": "^1.3|^2.0",
2425
"doctrine/dbal": "2.5.*",
2526
"doctrine/phpcr-odm": "^1.0|^2.0"
2627
},
28+
"minimum-stability": "dev",
29+
"prefer-stable": true,
2730
"suggest": {
2831
"symfony/twig-bundle": "To get access to the CMF twig extension (^2.1)",
2932
"doctrine/phpcr-bundle": "To be able to use the CMF twig extension (^1.0)",
3033
"doctrine/phpcr-odm": "To be able to use the CMF twig extension (^1.0)",
3134
"symfony/security-bundle": "To be able to use the publish workflow system (^2.1)",
3235
"symfony-cmf/routing": "To be able to use the CMF twig extension functions cmf_prev_linkable/cmf_next_linkable (^1.2)",
33-
"symfony-cmf/routing-bundle": "To be able to enable the publish_workflow_listener (^1.2)",
36+
"symfony-cmf/routing-bundle": "To be able to enable the publish_workflow_listener (^2.0)",
3437
"symfony-cmf/sonata-admin-integration-bundle": "To provide an admin interface for the PHPCR ODM documents."
3538
},
3639
"autoload": {

src/DependencyInjection/CmfCoreExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function prepend(ContainerBuilder $container)
3737
$config = $this->processConfiguration(new Configuration(), $configs);
3838

3939
$extensions = $container->getExtensions();
40-
if (isset($config['multilang']['locales']) && isset($extensions['cmf_routing'])) {
40+
if (isset($config['multilang']['locales'], $extensions['cmf_routing'])) {
4141
$container->prependExtensionConfig('cmf_routing', array(
4242
'dynamic' => array('locales' => $config['multilang']['locales']),
4343
));

tests/Functional/Form/CheckboxUrlLabelFormTypeTest.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,32 @@
1111

1212
namespace Symfony\Cmf\Bundle\CoreBundle\Tests\Functional\Form;
1313

14+
use Symfony\Bridge\Twig\Form\TwigRenderer;
15+
use Symfony\Bridge\Twig\Extension\FormExtension;
16+
use Symfony\Cmf\Bundle\CoreBundle\Tests\Resources\DataFixture\LoadRouteData;
1417
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1518
use Symfony\Cmf\Component\Testing\Functional\BaseTestCase;
1619
use Symfony\Cmf\Bundle\CoreBundle\Form\Type\CheckboxUrlLabelFormType;
20+
use Symfony\Bundle\TwigBundle\ContainerAwareRuntimeLoader;
1721

1822
class CheckboxUrlLabelFormTypeTest extends BaseTestCase
1923
{
2024
public function setUp()
2125
{
22-
$this->db('PHPCR')->loadFixtures(array('\Symfony\Cmf\Bundle\CoreBundle\Tests\Resources\DataFixture\LoadRouteData'));
26+
$this->db('PHPCR')->loadFixtures(array(LoadRouteData::class));
2327
}
2428

2529
public function testFormTwigTemplate()
2630
{
27-
$twigExtension = $this->getContainer()->get('twig');
28-
$twigExtension->initRuntime();
29-
$renderer = $twigExtension->getExtension('form')->renderer;
31+
$twig = $this->getContainer()->get('twig');
32+
if (class_exists(ContainerAwareRuntimeLoader::class)) {
33+
// TwigBridge 3.2+
34+
$renderer = $twig->getRuntime(TwigRenderer::class);
35+
} else {
36+
$twig25 = !method_exists($twig, 'getRuntime');
37+
$renderer = $twig->getExtension($twig25 ? 'form' : FormExtension::class)->renderer;
38+
$renderer->setEnvironment($twig);
39+
}
3040

3141
$view = $this->getContainer()->get('form.factory')->createNamedBuilder('name')
3242
->add('terms', CheckboxUrlLabelFormType::class, array(

tests/Functional/Twig/ServiceTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111

1212
namespace Symfony\Cmf\Bundle\CoreBundle\Tests\Functional\Twig;
1313

14+
use Symfony\Cmf\Bundle\CoreBundle\Twig\Extension\CmfExtension;
1415
use Symfony\Cmf\Component\Testing\Functional\BaseTestCase;
1516

1617
class ServiceTest extends BaseTestCase
1718
{
1819
public function testContainer()
1920
{
21+
/** @var \Twig_Environment $twig */
2022
$twig = $this->getContainer()->get('twig');
21-
$ext = $twig->getExtension('cmf');
23+
$ext = $twig->getExtension(method_exists($twig, 'getRuntime') ? CmfExtension::class : 'cmf');
2224
$this->assertNotEmpty($ext);
2325
}
2426
}

0 commit comments

Comments
 (0)