Skip to content

Commit 752c7cb

Browse files
Merge branch '3.4' into 4.0
* 3.4: Fix lock strategy tests [travis] cache compiled php extensions fix merge Allow remember-me factory creation when multiple user providers are configured. Add tests for glob loaders Improve assertions [DI][Routing] Fix tracking of globbed resources [Config] Handle Service/EventSubscriberInterface in ReflectionClassResource always call the parent class' constructor
2 parents e1e523b + f5060c1 commit 752c7cb

File tree

48 files changed

+663
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+663
-78
lines changed

.travis.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ cache:
3232
directories:
3333
- .phpunit
3434
- php-$MIN_PHP
35+
- php-ext
3536

3637
services:
3738
- memcached
@@ -97,6 +98,23 @@ before_install:
9798
echo extension = redis.so >> $INI
9899
echo extension = memcached.so >> $INI
99100
101+
# tpecl is a helper to compile and cache php extensions
102+
tpecl () {
103+
local ext_name=$1
104+
local ext_so=$2
105+
local ext_dir=$(php -r "echo ini_get('extension_dir');")
106+
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
107+
108+
if [[ -e $ext_cache/$ext_so ]]; then
109+
echo extension = $ext_cache/$ext_so >> $INI
110+
else
111+
mkdir -p $ext_cache
112+
echo yes | pecl install -f $ext_name &&
113+
cp $ext_dir/$ext_so $ext_cache
114+
fi
115+
}
116+
export -f tpecl
117+
100118
# Matrix lines for intermediate PHP versions are skipped for pull requests
101119
if [[ ! $deps && ! $PHP = $MIN_PHP && $TRAVIS_PULL_REQUEST != false ]]; then
102120
deps=skip
@@ -115,8 +133,8 @@ before_install:
115133
- |
116134
# Install extra PHP extensions
117135
if [[ ! $skip ]]; then
118-
tfold ext.apcu5 'echo yes | pecl install -f apcu-5.1.6'
119-
tfold ext.mongodb pecl install -f mongodb-1.4.0RC1
136+
tfold ext.apcu tpecl apcu-5.1.6 apcu.so
137+
tfold ext.mongodb tpecl mongodb-1.4.0RC1 mongodb.so
120138
fi
121139
122140
- |

src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testResetService()
4040
$registry->resetManager();
4141

4242
$this->assertSame($foo, $container->get('foo'));
43-
$this->assertFalse(isset($foo->bar));
43+
$this->assertObjectNotHasAttribute('bar', $foo);
4444
}
4545
}
4646

src/Symfony/Bridge/Monolog/Tests/LoggerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testGetLogsWithDebugProcessor()
4343
$logger = new Logger(__METHOD__, array($handler), array($processor));
4444

4545
$this->assertTrue($logger->error('error message'));
46-
$this->assertSame(1, count($logger->getLogs()));
46+
$this->assertCount(1, $logger->getLogs());
4747
}
4848

4949
public function testCountErrorsWithDebugProcessor()

src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<argument type="service" id="file_locator" />
3131
</service>
3232

33-
<service id="routing.loader.glob" class="Symfony\Component\Config\Loader\GlobFileLoader">
33+
<service id="routing.loader.glob" class="Symfony\Component\Routing\Loader\GlobFileLoader">
3434
<tag name="routing.loader" />
3535
<argument type="service" id="file_locator" />
3636
</service>

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ private function assertCachePoolServiceDefinitionIsCreated(ContainerBuilder $con
11011101
$this->assertFalse($poolDefinition->isAbstract(), sprintf('Service definition "%s" is not abstract.', $id));
11021102

11031103
$tag = $poolDefinition->getTag('cache.pool');
1104-
$this->assertTrue(isset($tag[0]['default_lifetime']), 'The default lifetime is stored as an attribute of the "cache.pool" tag.');
1104+
$this->assertArrayHasKey('default_lifetime', $tag[0], 'The default lifetime is stored as an attribute of the "cache.pool" tag.');
11051105
$this->assertSame($defaultLifetime, $tag[0]['default_lifetime'], 'The default lifetime is stored as an attribute of the "cache.pool" tag.');
11061106

11071107
$parentDefinition = $poolDefinition;

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"symfony/polyfill-mbstring": "~1.0",
2828
"symfony/filesystem": "~3.4|~4.0",
2929
"symfony/finder": "~3.4|~4.0",
30-
"symfony/routing": "~3.4|~4.0"
30+
"symfony/routing": "^3.4.5|^4.0.5"
3131
},
3232
"require-dev": {
3333
"doctrine/cache": "~1.0",

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ private function createAuthenticationListeners($container, $id, $firewall, &$aut
409409
throw new InvalidConfigurationException(sprintf('Invalid firewall "%s": user provider "%s" not found.', $id, $firewall[$key]['provider']));
410410
}
411411
$userProvider = $providerIds[$normalizedName];
412+
} elseif ('remember_me' === $key) {
413+
// RememberMeFactory will use the firewall secret when created
414+
$userProvider = null;
412415
} elseif($defaultProvider) {
413416
$userProvider = $defaultProvider;
414417
} else {

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,28 @@ public function testMissingProviderForListener()
193193
$container->compile();
194194
}
195195

196+
public function testPerListenerProviderWithRememberMe()
197+
{
198+
$container = $this->getRawContainer();
199+
$container->loadFromExtension('security', array(
200+
'providers' => array(
201+
'first' => array('id' => 'foo'),
202+
'second' => array('id' => 'bar'),
203+
),
204+
205+
'firewalls' => array(
206+
'default' => array(
207+
'form_login' => array('provider' => 'second'),
208+
'logout_on_user_change' => true,
209+
'remember_me' => array('secret' => 'baz'),
210+
),
211+
),
212+
));
213+
214+
$container->compile();
215+
$this->addToAssertionCount(1);
216+
}
217+
196218
protected function getRawContainer()
197219
{
198220
$container = new ContainerBuilder();

src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testGetItems()
5353
$itemKey = $item->getKey();
5454

5555
$this->assertEquals($itemKey, $key, 'Keys must be preserved when fetching multiple items');
56-
$this->assertTrue(in_array($key, $keys), 'Cache key can not change.');
56+
$this->assertContains($key, $keys, 'Cache key can not change.');
5757
$this->assertFalse($item->isHit());
5858

5959
// Remove $key for $keys

src/Symfony/Component/Cache/Tests/Adapter/ProxyAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testProxyfiedItem()
4343

4444
$proxyItem = $pool->getItem('foo');
4545

46-
$this->assertFalse($proxyItem === $item);
46+
$this->assertNotSame($item, $proxyItem);
4747
$pool->save($proxyItem->set('bar'));
4848
}
4949
}

0 commit comments

Comments
 (0)