Skip to content

Commit cb085f7

Browse files
Merge branch '2.7' into 2.8
* 2.7: [tests] Use @requires annotation when possible [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 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/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/composer.json src/Symfony/Component/Config/composer.json 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/composer.json src/Symfony/Component/HttpFoundation/composer.json src/Symfony/Component/HttpKernel/composer.json src/Symfony/Component/Intl/composer.json src/Symfony/Component/Locale/composer.json src/Symfony/Component/OptionsResolver/composer.json src/Symfony/Component/Process/composer.json src/Symfony/Component/PropertyAccess/composer.json src/Symfony/Component/Routing/composer.json src/Symfony/Component/Security/Acl/composer.json src/Symfony/Component/Security/Core/composer.json src/Symfony/Component/Security/Csrf/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/Tests/Dumper/IcuResFileDumperTest.php src/Symfony/Component/Translation/composer.json src/Symfony/Component/Validator/composer.json src/Symfony/Component/VarDumper/composer.json src/Symfony/Component/Yaml/composer.json
2 parents 3a17529 + 6578a21 commit cb085f7

11 files changed

+30
-45
lines changed

Tests/AbstractLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
2323
protected function setUp()
2424
{
2525
if (!extension_loaded('intl')) {
26-
$this->markTestSkipped('The "intl" extension is not available');
26+
$this->markTestSkipped('Extension intl is required.');
2727
}
2828

2929
\Locale::setDefault('en');

Tests/Extension/Core/DataTransformer/DateTimeToArrayTransformerTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,11 @@ public function testTransformDifferentTimezones()
116116
$this->assertSame($output, $transformer->transform($input));
117117
}
118118

119+
/**
120+
* @requires PHP 5.5
121+
*/
119122
public function testTransformDateTimeImmutable()
120123
{
121-
if (PHP_VERSION_ID < 50500) {
122-
$this->markTestSkipped('DateTimeImmutable was introduced in PHP 5.5.0');
123-
}
124-
125124
$transformer = new DateTimeToArrayTransformer('America/New_York', 'Asia/Hong_Kong');
126125

127126
$input = new \DateTimeImmutable('2010-02-03 04:05:06 America/New_York');

Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@ public function testTransformWithDifferentPatterns()
141141
$this->assertEquals('02*2010*03 04|05|06', $transformer->transform($this->dateTime));
142142
}
143143

144+
/**
145+
* @requires PHP 5.5
146+
*/
144147
public function testTransformDateTimeImmutableTimezones()
145148
{
146-
if (PHP_VERSION_ID < 50500) {
147-
$this->markTestSkipped('DateTimeImmutable was introduced in PHP 5.5.0');
148-
}
149-
150149
$transformer = new DateTimeToLocalizedStringTransformer('America/New_York', 'Asia/Hong_Kong');
151150

152151
$input = new \DateTimeImmutable('2010-02-03 04:05:06 America/New_York');

Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,10 @@ public function testTransform($fromTz, $toTz, $from, $to)
8181

8282
/**
8383
* @dataProvider transformProvider
84+
* @requires PHP 5.5
8485
*/
8586
public function testTransformDateTimeImmutable($fromTz, $toTz, $from, $to)
8687
{
87-
if (PHP_VERSION_ID < 50500) {
88-
$this->markTestSkipped('DateTimeImmutable was introduced in PHP 5.5.0');
89-
}
90-
9188
$transformer = new DateTimeToRfc3339Transformer($fromTz, $toTz);
9289

9390
$this->assertSame($to, $transformer->transform(null !== $from ? new \DateTimeImmutable($from) : null));

Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,11 @@ public function testTransformWithDifferentTimezones()
9494
$this->assertEquals($output, $transformer->transform($input));
9595
}
9696

97+
/**
98+
* @requires PHP 5.5
99+
*/
97100
public function testTransformDateTimeImmutable()
98101
{
99-
if (PHP_VERSION_ID < 50500) {
100-
$this->markTestSkipped('DateTimeImmutable was introduced in PHP 5.5.0');
101-
}
102-
103102
$transformer = new DateTimeToStringTransformer('Asia/Hong_Kong', 'America/New_York', 'Y-m-d H:i:s');
104103

105104
$input = new \DateTimeImmutable('2010-02-03 12:05:06 America/New_York');

Tests/Extension/Core/DataTransformer/DateTimeToTimestampTransformerTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ public function testTransformFromDifferentTimezone()
5656
$this->assertEquals($output, $transformer->transform($input));
5757
}
5858

59+
/**
60+
* @requires PHP 5.5
61+
*/
5962
public function testTransformDateTimeImmutable()
6063
{
61-
if (PHP_VERSION_ID < 50500) {
62-
$this->markTestSkipped('DateTimeImmutable was introduced in PHP 5.5.0');
63-
}
64-
6564
$transformer = new DateTimeToTimestampTransformer('Asia/Hong_Kong', 'America/New_York');
6665

6766
$input = new \DateTimeImmutable('2010-02-03 04:05:06 America/New_York');

Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,13 @@ public function testReverseTransformWithGrouping($to, $from, $locale)
236236
$this->assertEquals($to, $transformer->reverseTransform($from));
237237
}
238238

239-
// https://github.com/symfony/symfony/issues/7609
239+
/**
240+
* @see https://github.com/symfony/symfony/issues/7609
241+
*
242+
* @requires extension mbstring
243+
*/
240244
public function testReverseTransformWithGroupingAndFixedSpaces()
241245
{
242-
if (!function_exists('mb_detect_encoding')) {
243-
$this->markTestSkipped('The "mbstring" extension is required for this test.');
244-
}
245-
246246
// Since we test against other locales, we need the full implementation
247247
IntlTestHelper::requireFullIntl($this);
248248

@@ -583,13 +583,10 @@ public function testReverseTransformDisallowsCenteredExtraCharacters()
583583
/**
584584
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
585585
* @expectedExceptionMessage The number contains unrecognized characters: "foo8"
586+
* @requires extension mbstring
586587
*/
587588
public function testReverseTransformDisallowsCenteredExtraCharactersMultibyte()
588589
{
589-
if (!function_exists('mb_detect_encoding')) {
590-
$this->markTestSkipped('The "mbstring" extension is required for this test.');
591-
}
592-
593590
// Since we test against other locales, we need the full implementation
594591
IntlTestHelper::requireFullIntl($this);
595592

@@ -603,13 +600,10 @@ public function testReverseTransformDisallowsCenteredExtraCharactersMultibyte()
603600
/**
604601
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
605602
* @expectedExceptionMessage The number contains unrecognized characters: "foo8"
603+
* @requires extension mbstring
606604
*/
607605
public function testReverseTransformIgnoresTrailingSpacesInExceptionMessage()
608606
{
609-
if (!function_exists('mb_detect_encoding')) {
610-
$this->markTestSkipped('The "mbstring" extension is required for this test.');
611-
}
612-
613607
// Since we test against other locales, we need the full implementation
614608
IntlTestHelper::requireFullIntl($this);
615609

@@ -634,13 +628,10 @@ public function testReverseTransformDisallowsTrailingExtraCharacters()
634628
/**
635629
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
636630
* @expectedExceptionMessage The number contains unrecognized characters: "foo"
631+
* @requires extension mbstring
637632
*/
638633
public function testReverseTransformDisallowsTrailingExtraCharactersMultibyte()
639634
{
640-
if (!function_exists('mb_detect_encoding')) {
641-
$this->markTestSkipped('The "mbstring" extension is required for this test.');
642-
}
643-
644635
// Since we test against other locales, we need the full implementation
645636
IntlTestHelper::requireFullIntl($this);
646637

Tests/Extension/Core/Type/DateTypeTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,7 @@ public function testDayErrorsBubbleUp($widget)
933933
public function testYearsFor32BitsMachines()
934934
{
935935
if (4 !== PHP_INT_SIZE) {
936-
$this->markTestSkipped(
937-
'PHP must be compiled in 32 bit mode to run this test');
936+
$this->markTestSkipped('PHP 32 bit is required.');
938937
}
939938

940939
$form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateType', null, array(

Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ public function testGenerateCsrfToken()
4848
$this->assertEquals(sha1('SECRET'.'foo'.session_id()), $token);
4949
}
5050

51+
/**
52+
* @requires PHP 5.4
53+
*/
5154
public function testGenerateCsrfTokenOnUnstartedSession()
5255
{
5356
session_id('touti');
5457

55-
if (PHP_VERSION_ID < 50400) {
56-
$this->markTestSkipped('This test requires PHP >= 5.4');
57-
}
58-
5958
$this->assertSame(PHP_SESSION_NONE, session_status());
6059

6160
$token = $this->provider->generateCsrfToken('foo');

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"symfony/property-access": "~2.3|~3.0.0"
2424
},
2525
"require-dev": {
26-
"symfony/phpunit-bridge": "~2.7|~3.0.0",
2726
"doctrine/collections": "~1.0",
2827
"symfony/validator": "~2.8|~3.0.0",
2928
"symfony/dependency-injection": "~2.3|~3.0.0",

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)