Skip to content

Commit 9494c37

Browse files
Merge branch '2.3' into 2.7
* 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
2 parents a997e7f + bdc1508 commit 9494c37

File tree

7 files changed

+17
-24
lines changed

7 files changed

+17
-24
lines changed

Tests/Dumper/IcuResFileDumperTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616

1717
class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase
1818
{
19+
/**
20+
* @requires extension mbstring
21+
*/
1922
public function testDump()
2023
{
21-
if (!function_exists('mb_convert_encoding')) {
22-
$this->markTestSkipped('This test requires mbstring to work.');
23-
}
24-
2524
$catalogue = new MessageCatalogue('en');
2625
$catalogue->add(array('foo' => 'bar'));
2726

Tests/Loader/IcuDatFileLoaderTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@
1414
use Symfony\Component\Translation\Loader\IcuDatFileLoader;
1515
use Symfony\Component\Config\Resource\FileResource;
1616

17+
/**
18+
* @requires extension intl
19+
*/
1720
class IcuDatFileLoaderTest extends LocalizedTestCase
1821
{
19-
protected function setUp()
20-
{
21-
if (!extension_loaded('intl')) {
22-
$this->markTestSkipped('This test requires intl extension to work.');
23-
}
24-
}
25-
2622
/**
2723
* @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException
2824
*/

Tests/Loader/IcuResFileLoaderTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@
1414
use Symfony\Component\Translation\Loader\IcuResFileLoader;
1515
use Symfony\Component\Config\Resource\DirectoryResource;
1616

17+
/**
18+
* @requires extension intl
19+
*/
1720
class IcuResFileLoaderTest extends LocalizedTestCase
1821
{
19-
protected function setUp()
20-
{
21-
if (!extension_loaded('intl')) {
22-
$this->markTestSkipped('This test requires intl extension to work.');
23-
}
24-
}
25-
2622
public function testLoad()
2723
{
2824
// resource is build using genrb command

Tests/Loader/LocalizedTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ abstract class LocalizedTestCase extends \PHPUnit_Framework_TestCase
1616
protected function setUp()
1717
{
1818
if (!extension_loaded('intl')) {
19-
$this->markTestSkipped('The "intl" extension is not available');
19+
$this->markTestSkipped('Extension intl is required.');
2020
}
2121
}
2222
}

Tests/Loader/XliffFileLoaderTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ public function testIncompleteResource()
5959
$this->assertEquals(array('foo' => 'bar', 'extra' => 'extra', 'key' => '', 'test' => 'with'), $catalogue->all('domain1'));
6060
}
6161

62+
/**
63+
* @requires extension mbstring
64+
*/
6265
public function testEncoding()
6366
{
64-
if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) {
65-
$this->markTestSkipped('The iconv and mbstring extensions are not available.');
66-
}
67-
6867
$loader = new XliffFileLoader();
6968
$catalogue = $loader->load(__DIR__.'/../fixtures/encoding.xlf', 'en', 'domain1');
7069

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"php": ">=5.3.9"
2020
},
2121
"require-dev": {
22-
"symfony/phpunit-bridge": "~2.7",
2322
"symfony/config": "~2.7",
2423
"symfony/intl": "~2.4",
2524
"symfony/yaml": "~2.2",

phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@
2525
</exclude>
2626
</whitelist>
2727
</filter>
28+
29+
<listeners>
30+
<listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
31+
</listeners>
2832
</phpunit>

0 commit comments

Comments
 (0)