Skip to content

Commit

Permalink
Merge branch '2.3' into 2.7
Browse files Browse the repository at this point in the history
* 2.3:
  [tests] Use @requires annotation when possible
  [ci] Enable collecting and replaying skipped tests
  [Process] Workaround buggy PHP warning
  [Console] Add additional ways to detect OS400 platform
  [Yaml] Allow tabs before comments at the end of a line

Conflicts:
	composer.json
	src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php
	src/Symfony/Bridge/Monolog/composer.json
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Component/Asset/composer.json
	src/Symfony/Component/ClassLoader/Tests/LegacyApcUniversalClassLoaderTest.php
	src/Symfony/Component/Console/composer.json
	src/Symfony/Component/Debug/composer.json
	src/Symfony/Component/DomCrawler/composer.json
	src/Symfony/Component/EventDispatcher/composer.json
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
	src/Symfony/Component/HttpFoundation/composer.json
	src/Symfony/Component/Intl/composer.json
	src/Symfony/Component/Routing/composer.json
	src/Symfony/Component/Security/composer.json
	src/Symfony/Component/Serializer/composer.json
	src/Symfony/Component/Templating/composer.json
	src/Symfony/Component/Translation/composer.json
	src/Symfony/Component/Validator/composer.json
  • Loading branch information
nicolas-grekas committed Oct 10, 2015
2 parents c51cf35 + 36721bc commit fd18df0
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
8 changes: 7 additions & 1 deletion Output/ConsoleOutput.php
Expand Up @@ -125,7 +125,13 @@ protected function hasStderrSupport()
*/
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');
}

/**
Expand Down
7 changes: 3 additions & 4 deletions Tests/ApplicationTest.php
Expand Up @@ -551,12 +551,11 @@ public function testRenderException()
$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())
Expand Down
13 changes: 6 additions & 7 deletions Tests/Helper/FormatterHelperTest.php
Expand Up @@ -52,12 +52,11 @@ public function testFormatBlock()
);
}

/**
* @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(
Expand All @@ -69,11 +68,11 @@ public function testFormatBlockWithDiacriticLetters()
);
}

/**
* @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".
Expand Down
7 changes: 3 additions & 4 deletions Tests/Helper/LegacyProgressHelperTest.php
Expand Up @@ -167,12 +167,11 @@ public function testRedrawFrequency()
$progress->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');
}

$progress = new ProgressHelper();
$progress->start($output = $this->getOutputStream());
$progress->setBarCharacter('■');
Expand Down
14 changes: 6 additions & 8 deletions Tests/Helper/LegacyTableHelperTest.php
Expand Up @@ -256,12 +256,11 @@ public function testRenderProvider()
);
}

/**
* @requires extension mbstring
*/
public function testRenderMultiByte()
{
if (!function_exists('mb_strwidth')) {
$this->markTestSkipped('The "mbstring" extension is not available');
}

$table = new TableHelper();
$table
->setHeaders(array('■■'))
Expand All @@ -283,12 +282,11 @@ public function testRenderMultiByte()
$this->assertEquals($expected, $this->getOutputContent($output));
}

/**
* @requires extension mbstring
*/
public function testRenderFullWidthCharacters()
{
if (!function_exists('mb_strwidth')) {
$this->markTestSkipped('The "mbstring" extension is not available');
}

$table = new TableHelper();
$table
->setHeaders(array('あいうえお'))
Expand Down
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -19,7 +19,6 @@
"php": ">=5.3.9"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7",
"symfony/event-dispatcher": "~2.1",
"symfony/process": "~2.1",
"psr/log": "~1.0"
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Expand Up @@ -26,4 +26,8 @@
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
</listeners>
</phpunit>

0 comments on commit fd18df0

Please sign in to comment.