Skip to content

Commit ad4242a

Browse files
updated symfony components
1 parent 1c341d7 commit ad4242a

File tree

6 files changed

+79
-26
lines changed

6 files changed

+79
-26
lines changed

.travis.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,48 @@ language: php
33
matrix:
44
fast_finish: true
55
include:
6-
- php: 5.5
6+
- php: 5.6
77
env:
88
- STORAGE=doctrine
9-
- php: 5.5
10-
env:
11-
- STORAGE=array
9+
- COMPOSER_FLAGS="--prefer-lowest --prefer-dist --no-interaction"
1210
- php: 5.6
1311
env:
1412
- STORAGE=doctrine
15-
- CODE_COVERAGE=true
1613
- php: 5.6
1714
env:
1815
- STORAGE=array
1916
- php: 7.0
2017
env:
2118
- STORAGE=doctrine
19+
- COMPOSER_FLAGS="--prefer-lowest --prefer-dist --no-interaction"
20+
- php: 7.0
21+
env:
22+
- STORAGE=doctrine
23+
- php: 7.0
24+
env:
25+
- STORAGE=array
26+
- php: 7.0
27+
env:
28+
- STORAGE=doctrine
29+
- COMPOSER_FLAGS="--prefer-lowest --prefer-dist --no-interaction"
2230
- php: 7.0
31+
env:
32+
- STORAGE=doctrine
33+
- php: 7.1
2334
env:
2435
- STORAGE=array
36+
- php: 7.1
37+
env:
38+
- STORAGE=doctrine
39+
- COMPOSER_FLAGS="--prefer-lowest --prefer-dist --no-interaction"
40+
- php: 7.1
41+
env:
42+
- STORAGE=doctrine
43+
- CODE_COVERAGE=true
2544

2645
install:
2746
- composer self-update
28-
- composer update
47+
- composer update $COMPOSER_FLAGS
2948
- composer info
3049

3150
before_script:

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
}
1111
],
1212
"require": {
13-
"php": "~5.5 || ~7.0",
14-
"php-task/php-task": "^1.2",
15-
"symfony/http-kernel": "^2.6 || ^3.0",
16-
"symfony/dependency-injection": "^2.6 || ^3.0",
17-
"symfony/expression-language": "^2.6 || ^3.0",
18-
"symfony/config": "^2.6 || ^3.0",
19-
"symfony/console": "^2.6 || ^3.0",
20-
"symfony/process": "^2.6 || ^3.0",
13+
"php": "^5.6 || ^7.0",
14+
"php-task/php-task": "^1.3",
15+
"symfony/http-kernel": "^2.6 || ^3.4 || ^4.0",
16+
"symfony/dependency-injection": "^2.6 || ^3.4 || ^4.0",
17+
"symfony/expression-language": "^2.6 || ^3.4 || ^4.0",
18+
"symfony/config": "^2.6 || ^3.4 || ^4.0",
19+
"symfony/console": "^2.6 || ^3.4 || ^4.0",
20+
"symfony/process": "^2.6 || ^3.4 || ^4.0",
2121
"doctrine/orm": "^2.5"
2222
},
2323
"require-dev": {
2424
"phpunit/phpunit": "^4.8",
25-
"symfony/framework-bundle": "^2.6",
26-
"symfony/finder": "^2.6",
25+
"symfony/framework-bundle": "^2.6 || ^3.4 || ^4.0",
26+
"symfony/finder": "^2.6 || ^3.4 || ^4.0",
2727
"doctrine/doctrine-bundle": "^1.5",
2828
"doctrine/data-fixtures": "^1.1"
2929
},

phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
7-
bootstrap="vendor/autoload.php">
7+
bootstrap="tests/bootstrap.php">
88
<php>
99
<ini name="error_reporting" value="-1" />
1010
<server name="KERNEL_DIR" value="tests/app" />
11+
<server name="KERNEL_CLASS" value="TestKernel" />
1112
</php>
1213

1314
<testsuites>

src/DependencyInjection/TaskExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function loadDoctrineAdapter(array $config, ContainerBuilder $container)
8989
*/
9090
private function loadLockingComponent(array $config, ContainerBuilder $container, LoaderInterface $loader)
9191
{
92-
if (!$config['enabled']) {
92+
if (!$config['enabled'] || 'null' === $config['storage']) {
9393
return $loader->load('locking/null.xml');
9494
}
9595

@@ -135,7 +135,7 @@ private function getLockingStorageAliases(ContainerBuilder $container)
135135
{
136136
$taggedServices = $container->findTaggedServiceIds('task.lock.storage');
137137

138-
$result = [];
138+
$result = ['null'];
139139
foreach ($taggedServices as $id => $tags) {
140140
foreach ($tags as $tag) {
141141
$result[$tag['alias']] = $id;

tests/app/TestKernel.php

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ protected function buildContainer()
6262
$loader->load('services.xml');
6363

6464
$container->setParameter('kernel.storage', $this->storage);
65+
$container->setParameter('container.build_id', hash('crc32', 'Abc123423456789'));
6566

6667
return $container;
6768
}
@@ -71,16 +72,32 @@ protected function buildContainer()
7172
*/
7273
protected function initializeContainer()
7374
{
74-
$fresh = false;
75+
static $first = true;
7576

76-
$container = $this->buildContainer();
77-
$container->compile();
77+
if ('test' !== $this->getEnvironment()) {
78+
parent::initializeContainer();
7879

79-
$this->container = $container;
80-
$this->container->set('kernel', $this);
80+
return;
81+
}
82+
83+
$debug = $this->debug;
8184

82-
if (!$fresh && $this->container->has('cache_warmer')) {
83-
$this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
85+
if (!$first) {
86+
// disable debug mode on all but the first initialization
87+
$this->debug = false;
8488
}
89+
90+
// will not work with --process-isolation
91+
$first = false;
92+
93+
try {
94+
parent::initializeContainer();
95+
} catch (\Exception $e) {
96+
$this->debug = $debug;
97+
98+
throw $e;
99+
}
100+
101+
$this->debug = $debug;
85102
}
86103
}

tests/bootstrap.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
use Doctrine\Common\Annotations\AnnotationRegistry;
4+
5+
$file = __DIR__ . '/../vendor/autoload.php';
6+
if (!file_exists($file)) {
7+
throw new RuntimeException('Install dependencies to run test suite.');
8+
}
9+
10+
$loader = require $file;
11+
12+
require __DIR__ . '/app/TestKernel.php';
13+
14+
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
15+
16+
return $loader;

0 commit comments

Comments
 (0)