Skip to content

Commit 9d9c252

Browse files
Merge branch '2.3' into 2.7
* 2.3: [ci] Fix tests requirements Conflicts: src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php
2 parents f30ae9a + f14aa48 commit 9d9c252

File tree

9 files changed

+28
-31
lines changed

9 files changed

+28
-31
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ before_install:
3232
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
3333
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then phpenv config-rm xdebug.ini; fi;
3434
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
35-
- if [[ "$TRAVIS_PHP_VERSION" =~ 5.[34] ]]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
35+
- if [[ "$TRAVIS_PHP_VERSION" =~ 5.[34] ]]; then echo -e "extension = apc.so\napc.enable_cli = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
3636
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Let's continue without memcache extension"; fi;
3737
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]] && [ "$deps" = "no" ]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo "extension = $(pwd)/modules/symfony_debug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini); fi;
3838
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi;

appveyor.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ install:
2626
- IF %PHP%==1 cd ext
2727
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/php_intl-3.0.0-5.3-nts-vc9-x86.zip
2828
- IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y > 7z.log
29-
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/apc/3.1.13/php_apc-3.1.13-5.3-nts-vc9-x86.zip
30-
- IF %PHP%==1 7z x php_apc-3.1.13-5.3-nts-vc9-x86.zip -y > 7z.log
29+
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/apcu/4.0.7/php_apcu-4.0.7-5.3-nts-vc9-x86.zip
30+
- IF %PHP%==1 7z x php_apcu-4.0.7-5.3-nts-vc9-x86.zip -y > 7z.log
3131
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/php_memcache-3.0.8-5.3-nts-vc9-x86.zip
3232
- IF %PHP%==1 7z x php_memcache-3.0.8-5.3-nts-vc9-x86.zip -y > 7z.log
3333
- IF %PHP%==1 cd ..
@@ -38,7 +38,8 @@ install:
3838
- IF %PHP%==1 echo extension_dir=ext >> php.ini-min
3939
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini-min
4040
- IF %PHP%==1 copy /Y php.ini-min php.ini-max
41-
- IF %PHP%==1 echo extension=php_apc.dll >> php.ini-max
41+
- IF %PHP%==1 echo extension=php_apcu.dll >> php.ini-max
42+
- IF %PHP%==1 echo apc.enable_cli=1 >> php.ini-max
4243
- IF %PHP%==1 echo extension=php_intl.dll >> php.ini-max
4344
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini-max
4445
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini-max

src/Symfony/Component/ClassLoader/Tests/LegacyApcUniversalClassLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class LegacyApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
2121
{
2222
protected function setUp()
2323
{
24-
if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
25-
$this->markTestSkipped('The apc extension is available, but not enabled.');
26-
} else {
24+
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
2725
apc_clear_cache('user');
26+
} else {
27+
$this->markTestSkipped('APC is not enabled.');
2828
}
2929
}
3030

src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,10 @@ public function testTrimSkipNonStrings()
4242

4343
/**
4444
* @dataProvider spaceProvider
45+
* @requires extension mbstring
4546
*/
4647
public function testTrimUtf8Separators($hex)
4748
{
48-
if (!function_exists('mb_convert_encoding')) {
49-
$this->markTestSkipped('The "mb_convert_encoding" function is not available');
50-
}
51-
5249
// Convert hexadecimal representation into binary
5350
// H: hex string, high nibble first (UCS-2BE)
5451
// *: repeat until end of string

src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,20 @@ public function getName()
4747
}
4848
}
4949

50+
/**
51+
* @requires extension mongo
52+
*/
5053
class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest
5154
{
5255
protected static $storage;
5356

5457
public static function setUpBeforeClass()
5558
{
56-
if (extension_loaded('mongo')) {
57-
self::$storage = new DummyMongoDbProfilerStorage('mongodb://localhost/symfony_tests/profiler_data', '', '', 86400);
58-
try {
59-
self::$storage->getMongo();
60-
} catch (\MongoConnectionException $e) {
61-
self::$storage = null;
62-
}
59+
self::$storage = new DummyMongoDbProfilerStorage('mongodb://localhost/symfony_tests/profiler_data', '', '', 86400);
60+
try {
61+
self::$storage->getMongo();
62+
} catch (\MongoConnectionException $e) {
63+
self::$storage = null;
6364
}
6465
}
6566

@@ -159,7 +160,7 @@ protected function setUp()
159160
if (self::$storage) {
160161
self::$storage->purge();
161162
} else {
162-
$this->markTestSkipped('MongoDbProfilerStorageTest requires the mongo PHP extension and a MongoDB server on localhost');
163+
$this->markTestSkipped('A MongoDB server on localhost is required.');
163164
}
164165
}
165166
}

src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
1515

16+
/**
17+
* @requires extension pdo_sqlite
18+
*/
1619
class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
1720
{
1821
protected static $dbFile;
@@ -34,9 +37,6 @@ public static function tearDownAfterClass()
3437

3538
protected function setUp()
3639
{
37-
if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) {
38-
$this->markTestSkipped('This test requires SQLite support in your environment');
39-
}
4040
self::$storage->purge();
4141
}
4242

src/Symfony/Component/Security/Acl/Tests/Dbal/AclProviderTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use Symfony\Component\Security\Acl\Dbal\Schema;
1818
use Doctrine\DBAL\DriverManager;
1919

20+
/**
21+
* @requires extension pdo_sqlite
22+
*/
2023
class AclProviderTest extends \PHPUnit_Framework_TestCase
2124
{
2225
protected $con;
@@ -141,10 +144,6 @@ public function testFindAcl()
141144

142145
protected function setUp()
143146
{
144-
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
145-
self::markTestSkipped('This test requires SQLite support in your environment');
146-
}
147-
148147
$this->con = DriverManager::getConnection(array(
149148
'driver' => 'pdo_sqlite',
150149
'memory' => true,

src/Symfony/Component/Security/Acl/Tests/Dbal/MutableAclProviderTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
use Doctrine\DBAL\DriverManager;
2828
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
2929

30+
/**
31+
* @requires extension pdo_sqlite
32+
*/
3033
class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
3134
{
3235
protected $con;
@@ -513,10 +516,6 @@ protected function callMethod($object, $method, array $args)
513516

514517
protected function setUp()
515518
{
516-
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
517-
self::markTestSkipped('This test requires SQLite support in your environment');
518-
}
519-
520519
$this->con = DriverManager::getConnection(array(
521520
'driver' => 'pdo_sqlite',
522521
'memory' => true,

src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class LegacyApcCacheTest extends \PHPUnit_Framework_TestCase
2121
{
2222
protected function setUp()
2323
{
24-
if (!ini_get('apc.enable') || !ini_get('apc.enable_cli')) {
24+
if (!ini_get('apc.enabled') || !ini_get('apc.enable_cli')) {
2525
$this->markTestSkipped('APC is not enabled.');
2626
}
2727
}

0 commit comments

Comments
 (0)