diff --git a/src/Symfony/Component/Console/Tests/Command/CommandTest.php b/src/Symfony/Component/Console/Tests/Command/CommandTest.php index c2c9b895ee..a5af27ca34 100644 --- a/src/Symfony/Component/Console/Tests/Command/CommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/CommandTest.php @@ -307,13 +307,12 @@ class CommandTest extends \PHPUnit_Framework_TestCase ); } - /** @dataProvider getSetCodeBindToClosureTests */ + /** + * @dataProvider getSetCodeBindToClosureTests + * @requires PHP 5.4 + */ public function testSetCodeBindToClosure($previouslyBound, $expected) { - if (PHP_VERSION_ID < 50400) { - $this->markTestSkipped('Test skipped, for PHP 5.4+ only.'); - } - $code = createClosure(); if ($previouslyBound) { $code = $code->bindTo($this); diff --git a/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php b/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php index 311ce9d3ef..ddbafe49dc 100644 --- a/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php +++ b/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php @@ -24,13 +24,10 @@ class StringUtilTest 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 diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php b/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php index 43c79d9cc6..3527f9b41b 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php @@ -41,6 +41,7 @@ class MongoDbProfilerStorageTestDataCollector extends DataCollector /** * @group legacy + * @requires extension mongo */ class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest { @@ -131,10 +132,6 @@ class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest protected function setUp() { - if (!extension_loaded('mongo')) { - $this->markTestSkipped('MongoDbProfilerStorageTest requires the mongo PHP extension and a MongoDB server on localhost'); - } - $this->storage = new MongoDbProfilerStorage('mongodb://localhost/symfony_tests/profiler_data', '', '', 86400); $m = new \ReflectionMethod($this->storage, 'getMongo'); $m->setAccessible(true); diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php b/src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php index 8f91ac1ac5..dbdebef6aa 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php @@ -15,6 +15,7 @@ use Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage; /** * @group legacy + * @requires extensin pdo_sqlite */ class SqliteProfilerStorageTest extends AbstractProfilerStorageTest { @@ -23,10 +24,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'); - } - $this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_storage'); if (file_exists($this->dbFile)) { @unlink($this->dbFile); diff --git a/src/Symfony/Component/Ldap/Tests/LdapClientTest.php b/src/Symfony/Component/Ldap/Tests/LdapClientTest.php index 5b67ea8540..22a548c272 100644 --- a/src/Symfony/Component/Ldap/Tests/LdapClientTest.php +++ b/src/Symfony/Component/Ldap/Tests/LdapClientTest.php @@ -13,15 +13,11 @@ namespace Symfony\Component\Security\Core\Tests\Authentication\Provider; use Symfony\Component\Ldap\LdapClient; +/** + * @requires extension ldap + */ class LdapClientTest extends \PHPUnit_Framework_TestCase { - protected function setUp() - { - if (!extension_loaded('ldap')) { - $this->markTestSkipped('The ldap extension is not available'); - } - } - /** * @dataProvider provideLdapEscapeValues */ diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php index ba00d1c792..0740997eed 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractors/ReflectionExtractorTest.php @@ -75,13 +75,10 @@ class ReflectionExtractorTest extends \PHPUnit_Framework_TestCase /** * @dataProvider php7TypesProvider + * @requires PHP 7.0 */ public function testExtractPhp7Type($property, array $type = null) { - if (!method_exists('\ReflectionMethod', 'getReturnType')) { - $this->markTestSkipped('Available only with PHP 7 and superior.'); - } - $this->assertEquals($type, $this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php7Dummy', $property, array())); } diff --git a/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php b/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php index 7122ddd135..7a20c6943d 100644 --- a/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php +++ b/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php @@ -16,6 +16,9 @@ use Symfony\Component\Translation\Dumper\IcuResFileDumper; class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase { + /** + * @requires extension mbstring + */ public function testFormatCatalogue() { if (!function_exists('mb_convert_encoding')) {