Merge branch '2.8'

* 2.8:
  Fix merge
  [tests] Use @requires annotation when possible
  [tests] Use @requires annotation when possible
  [PhpUnitBridge] Add SkippedTestsListener to collect and replay skipped tests
  [ci] Enable collecting and replaying skipped tests
  [tests] Use @requires annotation when possible
  [Process] Workaround buggy PHP warning
  [FrameworkBundle] Replace PhpFileCache by FilesystemCache
  [FrameworkBundle] composer suggest fix
  [Console] Add additional ways to detect OS400 platform
  [Yaml] Allow tabs before comments at the end of a line
  Added more tests for PropertyAccess

Conflicts:
	.travis.yml
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Bridge/Monolog/composer.json
	src/Symfony/Bridge/ProxyManager/composer.json
	src/Symfony/Bridge/Swiftmailer/composer.json
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/DebugBundle/composer.json
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Bundle/TwigBundle/composer.json
	src/Symfony/Bundle/WebProfilerBundle/composer.json
	src/Symfony/Component/Asset/composer.json
	src/Symfony/Component/BrowserKit/composer.json
	src/Symfony/Component/ClassLoader/Tests/ApcClassLoaderTest.php
	src/Symfony/Component/ClassLoader/composer.json
	src/Symfony/Component/Config/composer.json
	src/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.php
	src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php
	src/Symfony/Component/Console/composer.json
	src/Symfony/Component/CssSelector/composer.json
	src/Symfony/Component/Debug/composer.json
	src/Symfony/Component/DependencyInjection/composer.json
	src/Symfony/Component/DomCrawler/composer.json
	src/Symfony/Component/EventDispatcher/composer.json
	src/Symfony/Component/ExpressionLanguage/composer.json
	src/Symfony/Component/Filesystem/composer.json
	src/Symfony/Component/Finder/composer.json
	src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php
	src/Symfony/Component/Form/composer.json
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/LegacyPdoSessionHandlerTest.php
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php
	src/Symfony/Component/HttpFoundation/composer.json
	src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php
	src/Symfony/Component/HttpKernel/Tests/Profiler/SqliteProfilerStorageTest.php
	src/Symfony/Component/HttpKernel/composer.json
	src/Symfony/Component/Intl/Tests/Data/Bundle/Writer/PhpBundleWriterTest.php
	src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php
	src/Symfony/Component/Intl/composer.json
	src/Symfony/Component/Ldap/composer.json
	src/Symfony/Component/Locale/composer.json
	src/Symfony/Component/Locale/phpunit.xml.dist
	src/Symfony/Component/OptionsResolver/composer.json
	src/Symfony/Component/Process/composer.json
	src/Symfony/Component/PropertyAccess/composer.json
	src/Symfony/Component/PropertyInfo/composer.json
	src/Symfony/Component/Routing/composer.json
	src/Symfony/Component/Security/Core/composer.json
	src/Symfony/Component/Security/Csrf/composer.json
	src/Symfony/Component/Security/Guard/composer.json
	src/Symfony/Component/Security/Http/composer.json
	src/Symfony/Component/Security/composer.json
	src/Symfony/Component/Serializer/composer.json
	src/Symfony/Component/Stopwatch/composer.json
	src/Symfony/Component/Templating/composer.json
	src/Symfony/Component/Translation/composer.json
	src/Symfony/Component/Validator/Tests/Mapping/Cache/LegacyApcCacheTest.php
	src/Symfony/Component/Validator/composer.json
	src/Symfony/Component/VarDumper/composer.json
	src/Symfony/Component/Yaml/composer.json
This commit is contained in:
Nicolas Grekas 2015-10-10 12:22:50 +02:00
commit 2e11b8b2cb
151 changed files with 441 additions and 394 deletions

View File

@ -48,9 +48,9 @@ install:
- if [ "$deps" = "2.8" ]; then git fetch origin 2.8; git checkout -m FETCH_HEAD; export COMPOSER_ROOT_VERSION=2.8.x-dev; fi;
script:
- if [ "$deps" = "no" ]; then echo "$COMPONENTS" | parallel --gnu 'echo -e "\\nRunning {} tests"; $PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
- if [ "$deps" = "no" ]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
- if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
- if [ "$deps" = "high" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
- if [ "$deps" = "low" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
- if [ "$deps" = "2.8" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data,legacy'; fi;
- if [ "$deps" = "high" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
- if [ "$deps" = "low" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
- if [ "$deps" = "2.8" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data,legacy'; fi;
- if [ "$deps" = "skip" ]; then echo 'This matrix line is skipped for pull requests.'; fi;

View File

@ -14,6 +14,7 @@ init:
- SET PHP=1
- SET ANSICON=121x90 (121x90)
- SET PHP_INI_MATRIX=php.ini-min php.ini-max
- SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped
install:
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
@ -22,6 +23,7 @@ install:
- IF %PHP%==1 7z x php-5.5.9-nts-Win32-VC11-x86.zip -y > 7z.log
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- IF %PHP%==1 copy /Y php.ini-development php.ini-min
- IF %PHP%==1 echo max_execution_time=1200 >> php.ini-min
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini-min
- IF %PHP%==1 echo extension_dir=ext >> php.ini-min
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini-min

View File

@ -69,7 +69,6 @@
"symfony/yaml": "2.99.99"
},
"require-dev": {
"symfony/phpunit-bridge": "self.version",
"doctrine/data-fixtures": "1.0.*",
"doctrine/dbal": "~2.4",
"doctrine/orm": "~2.4,>=2.4.5",

16
phpunit
View File

@ -28,7 +28,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit")) {
// Build a standalone phpunit without symfony/yaml
$oldPwd = getcwd();
mkdir($PHPUNIT_DIR);
@mkdir($PHPUNIT_DIR);
chdir($PHPUNIT_DIR);
if (extension_loaded('openssl') && ini_get('allow_url_fopen')) {
stream_copy_to_stream(fopen("https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip", 'rb'), fopen("$PHPUNIT_VERSION.zip", 'wb'));
@ -41,6 +41,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit")) {
$zip->close();
chdir("phpunit-$PHPUNIT_VERSION");
passthru("$COMPOSER remove --no-update symfony/yaml");
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
passthru("$COMPOSER install --prefer-source --no-progress --ansi");
chdir($oldPwd);
}
@ -76,10 +77,13 @@ if ($phpIniMatrix) {
if (isset($argv[1]) && 'symfony' === $argv[1]) {
// Find Symfony components in plain php for Windows portability
$finder = new RecursiveDirectoryIterator(__DIR__.'/src/Symfony', FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::UNIX_PATHS);
$oldPwd = getcwd();
chdir(__DIR__);
$finder = new RecursiveDirectoryIterator('src/Symfony', FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::UNIX_PATHS);
$finder = new RecursiveIteratorIterator($finder);
$finder->setMaxDepth(3);
$skippedTests = isset($_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS']) ? $_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS'] : false;
$runningProcs = array();
foreach ($finder as $file => $fileInfo) {
@ -88,6 +92,10 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
// Run phpunit tests in parallel
if ($skippedTests) {
putenv("SYMFONY_PHPUNIT_SKIPPED_TESTS=$component/$skippedTests");
}
$c = ProcessUtils::escapeArgument($component);
if ($proc = proc_open(sprintf($cmd, $c, " > $c/phpunit.stdout 2> $c/phpunit.stderr"), array(), $pipes)) {
@ -98,6 +106,7 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
}
}
}
chdir($oldPwd);
// Fixes for colors support on appveyor
// See https://github.com/appveyor/ci/issues/373
@ -139,6 +148,9 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
}
unlink($file);
}
if ($skippedTests) {
@unlink("$component/$skippedTests");
}
if ($procStatus) {
$exit = 1;

View File

@ -43,4 +43,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -29,8 +29,8 @@ class DoctrineTestHelper
*/
public static function createTestEntityManager()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
\PHPUnit_Framework_TestCase::markTestSkipped('This test requires SQLite support in your environment');
if (!extension_loaded('pdo_sqlite')) {
\PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.');
}
$config = new \Doctrine\ORM\Configuration();

View File

@ -132,12 +132,11 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
));
}
/**
* @requires extension mbstring
*/
public function testLogUTF8LongString()
{
if (!function_exists('mb_detect_encoding')) {
$this->markTestSkipped('Testing log shortening of utf8 charsets requires the mb_detect_encoding() function.');
}
$logger = $this->getMock('Psr\\Log\\LoggerInterface');
$dbalLogger = $this

View File

@ -20,7 +20,6 @@
"doctrine/common": "~2.4"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/stopwatch": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",
"symfony/form": "~2.8|~3.0",

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -20,7 +20,6 @@
"monolog/monolog": "~1.11"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",
"symfony/event-dispatcher": "~2.8|~3.0"

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -0,0 +1,85 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\PhpUnit;
use Doctrine\Common\Annotations\AnnotationRegistry;
/**
* Collects and replays skipped tests.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class SkippedTestsListener extends \PHPUnit_Framework_BaseTestListener
{
private $state = -1;
private $skippedFile = false;
private $wasSkipped = array();
private $isSkipped = array();
public function __destruct()
{
if (0 < $this->state) {
file_put_contents($this->skippedFile, '<?php return '.var_export($this->isSkipped, true).';');
}
}
public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
{
$suiteName = $suite->getName();
if (-1 === $this->state) {
echo "Testing $suiteName\n";
$this->state = 0;
if (!class_exists('Doctrine\Common\Annotations\AnnotationRegistry', false) && class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
AnnotationRegistry::registerLoader('class_exists');
}
if ($this->skippedFile = getenv('SYMFONY_PHPUNIT_SKIPPED_TESTS')) {
$this->state = 1;
if (file_exists($this->skippedFile)) {
$this->state = 2;
if (!$this->wasSkipped = require $this->skippedFile) {
exit("All tests already ran successfully.\n");
}
}
}
} elseif (2 === $this->state) {
$skipped = array();
foreach ($suite->tests() as $test) {
if (!$test instanceof \PHPUnit_Framework_TestCase
|| isset($this->wasSkipped[$suiteName]['*'])
|| isset($this->wasSkipped[$suiteName][$test->getName()])) {
$skipped[] = $test;
}
}
$suite->setTests($skipped);
}
}
public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
{
if (0 < $this->state) {
if ($test instanceof \PHPUnit_Framework_TestCase) {
$class = get_class($test);
$method = $test->getName();
} else {
$class = $test->getName();
$method = '*';
}
$this->isSkipped[$class][$method] = 1;
}
}
}

View File

@ -24,7 +24,7 @@ gc_disable();
// Enforce a consistent locale
setlocale(LC_ALL, 'C');
if (class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
if (!class_exists('Doctrine\Common\Annotations\AnnotationRegistry', false) && class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
AnnotationRegistry::registerLoader('class_exists');
}

View File

@ -21,7 +21,6 @@
"ocramius/proxy-manager": "~0.4|~1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0"
},
"autoload": {

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -20,7 +20,6 @@
"twig/twig": "~1.20|~2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/asset": "~2.8|~3.0",
"symfony/finder": "~2.8|~3.0",
"symfony/form": "~2.8|~3.0",

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -22,7 +22,6 @@
"symfony/var-dumper": "~2.8|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",
"symfony/web-profiler-bundle": "~2.8|~3.0"

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -815,14 +815,14 @@ class FrameworkExtension extends Extension
}
$container
->getDefinition('annotations.php_file_cache')
->getDefinition('annotations.filesystem_cache')
->replaceArgument(0, $cacheDir)
;
}
$container
->getDefinition('annotations.cached_reader')
->replaceArgument(1, new Reference('file' !== $config['cache'] ? $config['cache'] : 'annotations.php_file_cache'))
->replaceArgument(1, new Reference('file' !== $config['cache'] ? $config['cache'] : 'annotations.filesystem_cache'))
->replaceArgument(2, $config['debug'])
;
$container->setAlias('annotation_reader', 'annotations.cached_reader');

View File

@ -13,7 +13,7 @@
<argument /><!-- Debug-Flag -->
</service>
<service id="annotations.php_file_cache" class="Doctrine\Common\Cache\PhpFileCache" public="false">
<service id="annotations.filesystem_cache" class="Doctrine\Common\Cache\FilesystemCache" public="false">
<argument /><!-- Cache-Directory -->
</service>

View File

@ -312,9 +312,9 @@ abstract class FrameworkExtensionTest extends TestCase
{
$container = $this->createContainerFromFile('full');
$this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.php_file_cache')->getArgument(0));
$this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.filesystem_cache')->getArgument(0));
$this->assertSame('annotations.cached_reader', (string) $container->getAlias('annotation_reader'));
$this->assertSame('annotations.php_file_cache', (string) $container->getDefinition('annotations.cached_reader')->getArgument(1));
$this->assertSame('annotations.filesystem_cache', (string) $container->getDefinition('annotations.cached_reader')->getArgument(1));
}
public function testFileLinkFormat()

View File

@ -34,7 +34,6 @@
"doctrine/annotations": "~1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/browser-kit": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",
"symfony/css-selector": "~2.8|~3.0",
@ -55,8 +54,7 @@
"symfony/form": "For using forms",
"symfony/serializer": "For using the serializer service",
"symfony/validator": "For using validation",
"symfony/yaml": "For using the debug:config and lint:yaml commands",
"doctrine/cache": "For using alternative cache drivers"
"symfony/yaml": "For using the debug:config and lint:yaml commands"
},
"autoload": {
"psr-4": { "Symfony\\Bundle\\FrameworkBundle\\": "" }

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -33,6 +33,7 @@ use Symfony\Component\Security\Acl\Permission\BasicPermissionMap;
* Tests SetAclCommand.
*
* @author Kévin Dunglas <kevin@les-tilleuls.coop>
* @requires extension pdo_sqlite
*/
class SetAclCommandTest extends WebTestCase
{
@ -41,9 +42,6 @@ class SetAclCommandTest extends WebTestCase
protected function setUp()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
self::markTestSkipped('This test requires SQLite support in your environment');
}
parent::setUp();
$this->deleteTmpDir('Acl');

View File

@ -22,7 +22,6 @@
"symfony/http-kernel": "~2.8|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/browser-kit": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -23,7 +23,6 @@
"symfony/http-kernel": "~2.8|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/stopwatch": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0",

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -22,7 +22,6 @@
"symfony/twig-bridge": "~2.8|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -22,7 +22,6 @@
"symfony/http-foundation": ""
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/http-foundation": "~2.8|~3.0"
},
"autoload": {

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -20,7 +20,6 @@
"symfony/dom-crawler": "~2.8|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0",
"symfony/css-selector": "~2.8|~3.0"
},

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -14,14 +14,13 @@ namespace Symfony\Component\ClassLoader\Tests;
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\ClassLoader\ClassLoader;
/**
* @requires extension apc
*/
class ApcClassLoaderTest extends \PHPUnit_Framework_TestCase
{
protected function setUp()
{
if (!extension_loaded('apc')) {
$this->markTestSkipped('The apc extension is not available.');
}
if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
$this->markTestSkipped('The apc extension is available, but not enabled.');
} else {

View File

@ -20,7 +20,6 @@
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/finder": "~2.8|~3.0"
},
"autoload": {

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -19,9 +19,6 @@
"php": ">=5.5.9",
"symfony/filesystem": "~2.8|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Config\\": "" }
},

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -125,7 +125,13 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
*/
private function isRunningOS400()
{
return 'OS400' === PHP_OS;
$checks = array(
function_exists('php_uname') ? php_uname('s') : '',
getenv('OSTYPE'),
PHP_OS,
);
return false !== stristr(implode(';', $checks), 'OS400');
}
/**

View File

@ -534,12 +534,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal');
}
/**
* @requires extension mbstring
*/
public function testRenderExceptionWithDoubleWidthCharacters()
{
if (!function_exists('mb_strwidth')) {
$this->markTestSkipped('The "mb_strwidth" function is not available');
}
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
$application->setAutoExit(false);
$application->expects($this->any())
@ -1040,12 +1039,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('interact called'.PHP_EOL.'called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
}
/**
* @requires function posix_isatty
*/
public function testCanCheckIfTerminalIsInteractive()
{
if (!function_exists('posix_isatty')) {
$this->markTestSkipped('posix_isatty function is required');
}
$application = new CustomDefaultCommandApplication();
$application->setAutoExit(false);

View File

@ -307,7 +307,9 @@ class CommandTest extends \PHPUnit_Framework_TestCase
);
}
/** @dataProvider getSetCodeBindToClosureTests */
/**
* @dataProvider getSetCodeBindToClosureTests
*/
public function testSetCodeBindToClosure($previouslyBound, $expected)
{
$code = createClosure();

View File

@ -52,12 +52,11 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase
);
}
/**
* @requires extension mbstring
*/
public function testFormatBlockWithDiacriticLetters()
{
if (!function_exists('mb_detect_encoding')) {
$this->markTestSkipped('This test requires mbstring to work.');
}
$formatter = new FormatterHelper();
$this->assertEquals(
@ -69,11 +68,11 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase
);
}
/**
* @requires extension mbstring
*/
public function testFormatBlockWithDoubleWidthDiacriticLetters()
{
if (!extension_loaded('mbstring')) {
$this->markTestSkipped('This test requires mbstring to work.');
}
$formatter = new FormatterHelper();
$this->assertEquals(
'<error> </error>'."\n".

View File

@ -270,12 +270,11 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
$bar->advance(1);
}
/**
* @requires extension mbstring
*/
public function testMultiByteSupport()
{
if (!function_exists('mb_strlen') || (false === $encoding = mb_detect_encoding('■'))) {
$this->markTestSkipped('The mbstring extension is needed for multi-byte support');
}
$bar = new ProgressBar($output = $this->getOutputStream());
$bar->start();
$bar->setBarCharacter('■');

View File

@ -464,12 +464,11 @@ TABLE
);
}
/**
* @requires extension mbstring
*/
public function testRenderMultiByte()
{
if (!function_exists('mb_strlen')) {
$this->markTestSkipped('The "mbstring" extension is not available');
}
$table = new Table($output = $this->getOutputStream());
$table
->setHeaders(array('■■'))

View File

@ -19,7 +19,6 @@
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/event-dispatcher": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0",
"psr/log": "~1.0"

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -22,9 +22,6 @@
"require": {
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\CssSelector\\": "" }
},

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -23,7 +23,6 @@
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/class-loader": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0"
},

View File

@ -28,4 +28,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -19,10 +19,6 @@ class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase
{
public function testExpressionLanguageProviderForwarding()
{
if (true !== class_exists('Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage')) {
$this->markTestSkipped('The ExpressionLanguage component isn\'t available!');
}
$tmpProviders = array();
$extension = $this->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');

View File

@ -19,7 +19,6 @@
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/yaml": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0"

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -19,7 +19,6 @@
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/css-selector": "~2.8|~3.0"
},
"suggest": {

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -19,7 +19,6 @@
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -18,9 +18,6 @@
"require": {
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\ExpressionLanguage\\": "" }
},

View File

@ -30,4 +30,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -95,25 +95,25 @@ class FilesystemTestCase extends \PHPUnit_Framework_TestCase
protected function markAsSkippedIfSymlinkIsMissing()
{
if (!function_exists('symlink')) {
$this->markTestSkipped('symlink is not supported');
$this->markTestSkipped('Function symlink is required.');
}
if ('\\' === DIRECTORY_SEPARATOR && false === self::$symlinkOnWindows) {
$this->markTestSkipped('symlink requires "Create symbolic links" privilege on windows');
$this->markTestSkipped('symlink requires "Create symbolic links" privilege on Windows');
}
}
protected function markAsSkippedIfChmodIsMissing()
{
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('chmod is not supported on windows');
$this->markTestSkipped('chmod is not supported on Windows');
}
}
protected function markAsSkippedIfPosixIsMissing()
{
if ('\\' === DIRECTORY_SEPARATOR || !function_exists('posix_isatty')) {
$this->markTestSkipped('Posix is not supported');
if (!function_exists('posix_isatty')) {
$this->markTestSkipped('Function posix_isatty is required.');
}
}
}

View File

@ -18,9 +18,6 @@
"require": {
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Filesystem\\": "" }
},

View File

@ -24,4 +24,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -18,9 +18,6 @@
"require": {
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Finder\\": "" }
},

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -23,7 +23,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
protected function setUp()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('The "intl" extension is not available');
$this->markTestSkipped('Extension intl is required.');
}
\Locale::setDefault('en');

View File

@ -236,13 +236,13 @@ class NumberToLocalizedStringTransformerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($to, $transformer->reverseTransform($from));
}
// https://github.com/symfony/symfony/issues/7609
/**
* @see https://github.com/symfony/symfony/issues/7609
*
* @requires extension mbstring
*/
public function testReverseTransformWithGroupingAndFixedSpaces()
{
if (!function_exists('mb_detect_encoding')) {
$this->markTestSkipped('The "mbstring" extension is required for this test.');
}
// Since we test against other locales, we need the full implementation
IntlTestHelper::requireFullIntl($this);
@ -583,13 +583,10 @@ class NumberToLocalizedStringTransformerTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
* @expectedExceptionMessage The number contains unrecognized characters: "foo8"
* @requires extension mbstring
*/
public function testReverseTransformDisallowsCenteredExtraCharactersMultibyte()
{
if (!function_exists('mb_detect_encoding')) {
$this->markTestSkipped('The "mbstring" extension is required for this test.');
}
// Since we test against other locales, we need the full implementation
IntlTestHelper::requireFullIntl($this);
@ -603,13 +600,10 @@ class NumberToLocalizedStringTransformerTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
* @expectedExceptionMessage The number contains unrecognized characters: "foo8"
* @requires extension mbstring
*/
public function testReverseTransformIgnoresTrailingSpacesInExceptionMessage()
{
if (!function_exists('mb_detect_encoding')) {
$this->markTestSkipped('The "mbstring" extension is required for this test.');
}
// Since we test against other locales, we need the full implementation
IntlTestHelper::requireFullIntl($this);
@ -634,13 +628,10 @@ class NumberToLocalizedStringTransformerTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
* @expectedExceptionMessage The number contains unrecognized characters: "foo"
* @requires extension mbstring
*/
public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte()
{
if (!function_exists('mb_detect_encoding')) {
$this->markTestSkipped('The "mbstring" extension is required for this test.');
}
// Since we test against other locales, we need the full implementation
IntlTestHelper::requireFullIntl($this);

View File

@ -905,8 +905,7 @@ class DateTypeTest extends TestCase
public function testYearsFor32BitsMachines()
{
if (4 !== PHP_INT_SIZE) {
$this->markTestSkipped(
'PHP must be compiled in 32 bit mode to run this test');
$this->markTestSkipped('PHP 32 bit is required.');
}
$form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateType', null, array(

View File

@ -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

View File

@ -23,7 +23,6 @@
"symfony/property-access": "~2.8|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"doctrine/collections": "~1.0",
"symfony/validator": "~2.8|~3.0",
"symfony/dependency-injection": "~2.8|~3.0",

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -68,13 +68,10 @@ class IpUtilsTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \RuntimeException
* @requires extension sockets
*/
public function testAnIpv6WithOptionDisabledIpv6()
{
if (!extension_loaded('sockets')) {
$this->markTestSkipped('Only works when the socket extension is enabled');
}
if (defined('AF_INET6')) {
$this->markTestSkipped('Only works when PHP is compiled with the option "disable-ipv6".');
}

View File

@ -208,10 +208,6 @@ class JsonResponseTest extends \PHPUnit_Framework_TestCase
*/
public function testSetContentJsonSerializeError()
{
if (!interface_exists('JsonSerializable')) {
$this->markTestSkipped('Interface JsonSerializable is available in PHP 5.4+');
}
$serializable = new JsonSerializableObject();
JsonResponse::create($serializable);

View File

@ -1006,13 +1006,10 @@ class RequestTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider getContentCantBeCalledTwiceWithResourcesProvider
* @requires PHP 5.6
*/
public function testGetContentCanBeCalledTwiceWithResources($first, $second)
{
if (PHP_VERSION_ID < 50600) {
$this->markTestSkipped('PHP < 5.6 does not allow to open php://input several times.');
}
$req = new Request();
$a = $req->getContent($first);
$b = $req->getContent($second);
@ -1279,12 +1276,11 @@ class RequestTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($request->isXmlHttpRequest());
}
/**
* @requires extension intl
*/
public function testIntlLocale()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('The intl extension is needed to run this test.');
}
$request = new Request();
$request->setDefaultLocale('fr');

View File

@ -13,6 +13,9 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcacheSessionHandler;
/**
* @requires extension memcache
*/
class MemcacheSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
const PREFIX = 'prefix_';
@ -26,10 +29,6 @@ class MemcacheSessionHandlerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Memcache')) {
$this->markTestSkipped('Skipped tests Memcache class is not present');
}
$this->memcache = $this->getMock('Memcache');
$this->storage = new MemcacheSessionHandler(
$this->memcache,

View File

@ -13,6 +13,9 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler;
/**
* @requires extension memcached
*/
class MemcachedSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
const PREFIX = 'prefix_';
@ -27,10 +30,6 @@ class MemcachedSessionHandlerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!class_exists('Memcached')) {
$this->markTestSkipped('Skipped tests Memcached class is not present');
}
if (version_compare(phpversion('memcached'), '2.2.0', '>=')) {
$this->markTestSkipped('Tests can only be run with memcached extension 2.1.0 or lower');
}

View File

@ -15,6 +15,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandl
/**
* @author Markus Bachmann <markus.bachmann@bachi.biz>
* @requires extension mongo
*/
class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
@ -27,10 +28,6 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
if (!extension_loaded('mongo')) {
$this->markTestSkipped('MongoDbSessionHandler requires the PHP "mongo" extension.');
}
$mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
$this->mongo = $this->getMockBuilder($mongoClass)

View File

@ -13,17 +13,13 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
/**
* @requires extension pdo_sqlite
*/
class PdoSessionHandlerTest extends \PHPUnit_Framework_TestCase
{
private $dbFile;
protected function setUp()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
$this->markTestSkipped('This test requires SQLite support in your environment');
}
}
protected function tearDown()
{
// make sure the temporary database file is deleted when it has been created (even when a test fails)

View File

@ -19,7 +19,6 @@
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0"
},
"autoload": {

View File

@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -33,10 +33,6 @@ class ValueExporterTest extends \PHPUnit_Framework_TestCase
public function testDateTimeImmutable()
{
if (!class_exists('DateTimeImmutable', false)) {
$this->markTestSkipped('Test skipped, class DateTimeImmutable does not exist.');
}
$dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC'));
$this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime));
}

View File

@ -23,7 +23,6 @@
"psr/log": "~1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/browser-kit": "~2.8|~3.0",
"symfony/class-loader": "~2.8|~3.0",
"symfony/config": "~2.8|~3.0",

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -16,6 +16,7 @@ use Symfony\Component\Intl\Intl;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
* @requires extension intl
*/
class IntlBundleReaderTest extends \PHPUnit_Framework_TestCase
{
@ -26,11 +27,6 @@ class IntlBundleReaderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
// We only run tests if the intl extension is loaded...
if (!Intl::isExtensionLoaded()) {
$this->markTestSkipped('The intl extension is not available.');
}
$this->reader = new IntlBundleReader();
}

View File

@ -64,13 +64,11 @@ class JsonBundleWriterTest extends \PHPUnit_Framework_TestCase
$this->assertFileEquals(__DIR__.'/Fixtures/en.json', $this->directory.'/en.json');
}
/**
* @requires extension intl
*/
public function testWriteResourceBundle()
{
// We only run tests if the intl extension is loaded...
if (!Intl::isExtensionLoaded()) {
$this->markTestSkipped('The intl extension is not available.');
}
$bundle = new \ResourceBundle('rb', __DIR__.'/Fixtures', false);
$this->writer->write($this->directory, 'en', $bundle);

View File

@ -64,13 +64,11 @@ class PhpBundleWriterTest extends \PHPUnit_Framework_TestCase
$this->assertFileEquals(__DIR__.'/Fixtures/en.php', $this->directory.'/en.php');
}
/**
* @requires extension intl
*/
public function testWriteResourceBundle()
{
// We only run tests if the intl extension is loaded...
if (!Intl::isExtensionLoaded()) {
$this->markTestSkipped('The intl extension is not available.');
}
$bundle = new \ResourceBundle('rb', __DIR__.'/Fixtures', false);
$this->writer->write($this->directory, 'en', $bundle);

View File

@ -369,10 +369,6 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase
public function testFormatWithIntlTimeZone()
{
if (!class_exists('IntlTimeZone')) {
$this->markTestSkipped('This test requires the IntlTimeZone class from the Intl extension.');
}
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT, \IntlTimeZone::createTimeZone('GMT+03:00'), IntlDateFormatter::GREGORIAN, 'zzzz');
$this->assertEquals('GMT+03:00', $formatter->format(0));

View File

@ -40,7 +40,7 @@ class IntlTestHelper
// * the intl extension is not loaded
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) {
$testCase->markTestSkipped('Please change ICU version to '.Intl::getIcuStubVersion());
$testCase->markTestSkipped('ICU version '.Intl::getIcuStubVersion().' is required.');
}
// Normalize the default locale in case this is not done explicitly
@ -67,12 +67,12 @@ class IntlTestHelper
{
// We only run tests if the intl extension is loaded...
if (!Intl::isExtensionLoaded()) {
$testCase->markTestSkipped('The intl extension is not available.');
$testCase->markTestSkipped('Extension intl is required.');
}
// ... and only if the version is *one specific version*
if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) {
$testCase->markTestSkipped('Please change ICU version to '.Intl::getIcuStubVersion());
$testCase->markTestSkipped('ICU version '.Intl::getIcuStubVersion().' is required.');
}
// Normalize the default locale in case this is not done explicitly
@ -95,7 +95,7 @@ class IntlTestHelper
public static function require32Bit(\PhpUnit_Framework_TestCase $testCase)
{
if (4 !== PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP must be compiled in 32 bit mode to run this test');
$testCase->markTestSkipped('PHP 32 bit is required.');
}
}
@ -107,7 +107,7 @@ class IntlTestHelper
public static function require64Bit(\PhpUnit_Framework_TestCase $testCase)
{
if (8 !== PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP must be compiled in 64 bit mode to run this test');
$testCase->markTestSkipped('PHP 64 bit is required.');
}
}

View File

@ -27,7 +27,6 @@
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0",
"symfony/filesystem": "~2.8|~3.0"
},
"suggest": {

View File

@ -31,4 +31,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -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
*/

View File

@ -19,9 +19,6 @@
"php": ">=5.5.9",
"ext-ldap": "*"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Ldap\\": "" }
},

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -18,9 +18,6 @@
"require": {
"php": ">=5.5.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.8|~3.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }
},

View File

@ -25,4 +25,8 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

View File

@ -56,7 +56,8 @@ class ExecutableFinder
$searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir'));
$dirs = array();
foreach ($searchPath as $path) {
if (is_dir($path)) {
// Silencing against https://bugs.php.net/69240
if (@is_dir($path)) {
$dirs[] = $path;
} else {
if (basename($path) == $name && is_executable($path)) {

View File

@ -72,10 +72,11 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
$this->assertNull($p->getTimeout());
}
/**
* @requires extension pcntl
*/
public function testStopWithTimeoutIsActuallyWorking()
{
$this->verifyPosixIsEnabled();
// exec is mandatory here since we send a signal to the process
// see https://github.com/symfony/symfony/issues/5030 about prepending
// command with exec
@ -702,16 +703,11 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($termSignal, $process->getTermSignal());
}
/**
* @requires function posix_kill
*/
public function testProcessThrowsExceptionWhenExternallySignaled()
{
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('Windows does not support POSIX signals');
}
if (!function_exists('posix_kill')) {
$this->markTestSkipped('posix_kill is required for this test');
}
$termSignal = defined('SIGKILL') ? SIGKILL : 9;
$process = $this->getProcess('exec php -r "while (true) {}"');
@ -884,10 +880,11 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
$this->assertNull($process->getPid());
}
/**
* @requires extension pcntl
*/
public function testSignal()
{
$this->verifyPosixIsEnabled();
$process = $this->getProcess('exec php -f '.__DIR__.'/SignalListener.php');
$process->start();
usleep(500000);
@ -900,10 +897,11 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('Caught SIGUSR1', $process->getOutput());
}
/**
* @requires extension pcntl
*/
public function testExitCodeIsAvailableAfterSignal()
{
$this->verifyPosixIsEnabled();
$process = $this->getProcess('sleep 4');
$process->start();
$process->signal(SIGKILL);
@ -920,10 +918,10 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \Symfony\Component\Process\Exception\LogicException
* @requires extension pcntl
*/
public function testSignalProcessNotRunning()
{
$this->verifyPosixIsEnabled();
$process = $this->getProcess(self::$phpBin.' -v');
$process->signal(SIGHUP);
}
@ -977,16 +975,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
);
}
private function verifyPosixIsEnabled()
{
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('POSIX signals do not work on Windows');
}
if (!defined('SIGUSR1')) {
$this->markTestSkipped('The pcntl extension is not enabled');
}
}
/**
* @expectedException \Symfony\Component\Process\Exception\RuntimeException
*/

View File

@ -36,10 +36,6 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase
public function testFind()
{
if (!defined('PHP_BINARY')) {
$this->markTestSkipped('Requires the PHP_BINARY constant');
}
if (ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
@ -70,10 +66,6 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase
public function testFindWithExtraDirs()
{
if (!defined('PHP_BINARY')) {
$this->markTestSkipped('Requires the PHP_BINARY constant');
}
if (ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
@ -90,10 +82,6 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase
public function testFindWithOpenBaseDir()
{
if (!defined('PHP_BINARY')) {
$this->markTestSkipped('Requires the PHP_BINARY constant');
}
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('Cannot run test on windows');
}
@ -115,11 +103,6 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase
if (ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
if (!defined('PHP_BINARY')) {
$this->markTestSkipped('Requires the PHP_BINARY constant');
}
if ('\\' === DIRECTORY_SEPARATOR) {
$this->markTestSkipped('Cannot run test on windows');
}

View File

@ -18,30 +18,6 @@ use Symfony\Component\Process\PhpExecutableFinder;
*/
class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase
{
/**
* tests find() with the env var PHP_PATH.
*/
public function testFindWithPhpPath()
{
if (defined('PHP_BINARY')) {
$this->markTestSkipped('The PHP binary is easily available as of PHP 5.4');
}
$f = new PhpExecutableFinder();
$current = $f->find();
//not executable PHP_PATH
putenv('PHP_PATH=/not/executable/php');
$this->assertFalse($f->find(), '::find() returns false for not executable PHP');
$this->assertFalse($f->find(false), '::find() returns false for not executable PHP');
//executable PHP_PATH
putenv('PHP_PATH='.$current);
$this->assertEquals($f->find(), $current, '::find() returns the executable PHP');
$this->assertEquals($f->find(false), $current, '::find() returns the executable PHP');
}
/**
* tests find() with the env var PHP_PATH.
*/
@ -72,26 +48,4 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments');
}
}
/**
* tests find() with default executable.
*/
public function testFindWithSuffix()
{
if (defined('PHP_BINARY')) {
$this->markTestSkipped('The PHP binary is easily available as of PHP 5.4');
}
putenv('PHP_PATH=');
putenv('PHP_PEAR_PHP_BIN=');
$f = new PhpExecutableFinder();
$current = $f->find();
//TODO maybe php executable is custom or even Windows
if ('\\' === DIRECTORY_SEPARATOR) {
$this->assertTrue(is_executable($current));
$this->assertTrue((bool) preg_match('/'.addslashes(DIRECTORY_SEPARATOR).'php\.(exe|bat|cmd|com)$/i', $current), '::find() returns the executable PHP with suffixes');
}
}
}

Some files were not shown because too many files have changed in this diff Show More