Merge branch '2.3' into 2.7

* 2.3:
  [ci] Fix tests requirements

Conflicts:
	src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php
This commit is contained in:
Nicolas Grekas 2015-10-12 11:20:33 +02:00
commit 9d9c252c89
9 changed files with 28 additions and 31 deletions

View File

@ -32,7 +32,7 @@ before_install:
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then phpenv config-rm xdebug.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" =~ 5.[34] ]]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- 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;
- 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;
- 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;
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi;

View File

@ -26,8 +26,8 @@ install:
- IF %PHP%==1 cd ext
- 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
- IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y > 7z.log
- 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
- IF %PHP%==1 7z x php_apc-3.1.13-5.3-nts-vc9-x86.zip -y > 7z.log
- 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
- IF %PHP%==1 7z x php_apcu-4.0.7-5.3-nts-vc9-x86.zip -y > 7z.log
- 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
- IF %PHP%==1 7z x php_memcache-3.0.8-5.3-nts-vc9-x86.zip -y > 7z.log
- IF %PHP%==1 cd ..
@ -38,7 +38,8 @@ install:
- IF %PHP%==1 echo extension_dir=ext >> php.ini-min
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini-min
- IF %PHP%==1 copy /Y php.ini-min php.ini-max
- IF %PHP%==1 echo extension=php_apc.dll >> php.ini-max
- IF %PHP%==1 echo extension=php_apcu.dll >> php.ini-max
- IF %PHP%==1 echo apc.enable_cli=1 >> php.ini-max
- IF %PHP%==1 echo extension=php_intl.dll >> php.ini-max
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini-max
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini-max

View File

@ -21,10 +21,10 @@ class LegacyApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
$this->markTestSkipped('The apc extension is available, but not enabled.');
} else {
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
apc_clear_cache('user');
} else {
$this->markTestSkipped('APC is not enabled.');
}
}

View File

@ -42,13 +42,10 @@ class TrimListenerTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider spaceProvider
* @requires extension mbstring
*/
public function testTrimUtf8Separators($hex)
{
if (!function_exists('mb_convert_encoding')) {
$this->markTestSkipped('The "mb_convert_encoding" function is not available');
}
// Convert hexadecimal representation into binary
// H: hex string, high nibble first (UCS-2BE)
// *: repeat until end of string

View File

@ -47,19 +47,20 @@ class MongoDbProfilerStorageTestDataCollector extends DataCollector
}
}
/**
* @requires extension mongo
*/
class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest
{
protected static $storage;
public static function setUpBeforeClass()
{
if (extension_loaded('mongo')) {
self::$storage = new DummyMongoDbProfilerStorage('mongodb://localhost/symfony_tests/profiler_data', '', '', 86400);
try {
self::$storage->getMongo();
} catch (\MongoConnectionException $e) {
self::$storage = null;
}
self::$storage = new DummyMongoDbProfilerStorage('mongodb://localhost/symfony_tests/profiler_data', '', '', 86400);
try {
self::$storage->getMongo();
} catch (\MongoConnectionException $e) {
self::$storage = null;
}
}
@ -159,7 +160,7 @@ class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest
if (self::$storage) {
self::$storage->purge();
} else {
$this->markTestSkipped('MongoDbProfilerStorageTest requires the mongo PHP extension and a MongoDB server on localhost');
$this->markTestSkipped('A MongoDB server on localhost is required.');
}
}
}

View File

@ -13,6 +13,9 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler;
use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage;
/**
* @requires extension pdo_sqlite
*/
class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
{
protected static $dbFile;
@ -34,9 +37,6 @@ class SqliteProfilerStorageTest extends AbstractProfilerStorageTest
protected function setUp()
{
if (!class_exists('SQLite3') && (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers()))) {
$this->markTestSkipped('This test requires SQLite support in your environment');
}
self::$storage->purge();
}

View File

@ -17,6 +17,9 @@ use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
use Symfony\Component\Security\Acl\Dbal\Schema;
use Doctrine\DBAL\DriverManager;
/**
* @requires extension pdo_sqlite
*/
class AclProviderTest extends \PHPUnit_Framework_TestCase
{
protected $con;
@ -141,10 +144,6 @@ class AclProviderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
self::markTestSkipped('This test requires SQLite support in your environment');
}
$this->con = DriverManager::getConnection(array(
'driver' => 'pdo_sqlite',
'memory' => true,

View File

@ -27,6 +27,9 @@ use Symfony\Component\Security\Acl\Dbal\Schema;
use Doctrine\DBAL\DriverManager;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
/**
* @requires extension pdo_sqlite
*/
class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
{
protected $con;
@ -513,10 +516,6 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
self::markTestSkipped('This test requires SQLite support in your environment');
}
$this->con = DriverManager::getConnection(array(
'driver' => 'pdo_sqlite',
'memory' => true,

View File

@ -21,7 +21,7 @@ class LegacyApcCacheTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!ini_get('apc.enable') || !ini_get('apc.enable_cli')) {
if (!ini_get('apc.enabled') || !ini_get('apc.enable_cli')) {
$this->markTestSkipped('APC is not enabled.');
}
}