Skip to content

Commit 416b70d

Browse files
committed
merged branch conf/test-fixes-for-ci.qa.php.net-2.0 (PR symfony#2750)
Commits ------- c1a798e Another style fix. eba9de1 Code style fix. 0b1abb3 1. Separated testing diacritic letters with additional check for mbstring in Symfony\Tests\Component\Console\Helper\FormatterHelperTest.php. 2. Added check if French locale was correctly set, skip the test otherwise in Symfony\Tests\Component\Yaml\InlineTest.php. 3. Inverted check for Windows platform since testing finding php with suffixes has meaning only in Windows in Symfony\Tests\Component\Process\PhpExecutableFinderTest.php. Discussion ---------- Test fixes for ci.qa.php.net 2.0 This is remake of symfony#2749 against 2.0 as requested by stof. Code style fix also applied. Original message below: My name is Shein Alexey and I'm writing on behalf of php-qa team. As you probably know we've set up build server for testing major php versions (5.3, 5.4 and trunk for now) on the url http://ci.qa.php.net. There's also an initiative also check these versions against major php projects with good test coverage like symfony. In our symfony builds some tests constantly fail (see http://ci.qa.php.net/view/php-userland/job/php-symfony2/420/testReport/ for example) so here are the fixes I come up with: Separated testing diacritic letters with additional check for mbstring in Symfony\Tests\Component\Console\Helper\FormatterHelperT Added check if French locale was correctly set, skip the test otherwise in Symfony\Tests\Component\Yaml\InlineTest.php. Inverted check for Windows platform since testing finding php with suffixes has meaning only in Windows in Symfony\Tests\Component\Process\PhpExecutableFinderTest.php. There is also erratic test Symfony\Tests\Component\HttpKernel\HttpCache\HttpCacheTest:testFetchesFullResponseWhenCacheStaleAndNoValidatorsPresent which randomly fails when Age header is non-zero, I'm not sure what to do here, maybe this check should be deleted since page can have age greater than zero. Let me know what you think. Thank you.
2 parents 857d868 + c1a798e commit 416b70d

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

tests/Symfony/Tests/Component/Console/Helper/FormatterHelperTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ public function testFormatBlock()
5050
$formatter->formatBlock('Some text to display', 'error', true),
5151
'::formatBlock() formats a message in a block'
5252
);
53+
}
54+
55+
public function testFormatBlockWithDiacriticLetters()
56+
{
57+
if (!extension_loaded('mbstring')) {
58+
$this->markTestSkipped('This test requires mbstring to work.');
59+
}
60+
61+
$formatter = new FormatterHelper();
5362

5463
$this->assertEquals(
5564
'<error> </error>' . "\n" .

tests/Symfony/Tests/Component/Process/PhpExecutableFinderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testFindWithSuffix()
4848
$current = $f->find();
4949

5050
//TODO maybe php executable is custom or even windows
51-
if (false === strstr(PHP_OS, 'WIN')) {
51+
if (false !== strstr(PHP_OS, 'WIN')) {
5252
$this->assertEquals($current, PHP_BINDIR.DIRECTORY_SEPARATOR.'php', '::find() returns the executable php with suffixes');
5353
}
5454
}

tests/Symfony/Tests/Component/Yaml/InlineTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ public function testDumpNumericValueWithLocale()
4747
$this->markTestSkipped('Your platform does not support locales.');
4848
}
4949

50-
setlocale(LC_ALL, 'fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
50+
$required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
51+
if (false === setlocale(LC_ALL, $required_locales)) {
52+
$this->markTestSkipped('Could not set any of required locales: ' . implode(", ", $required_locales));
53+
}
5154

5255
$this->assertEquals('1.2', Inline::dump(1.2));
5356
$this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0)));

0 commit comments

Comments
 (0)