8000 debug failures on AppVeyor · symfony/symfony@507f2f7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 507f2f7

Browse files
committed
debug failures on AppVeyor
1 parent c0cad92 commit 507f2f7

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ public function reverseTransform(mixed $value): ?\DateTime
119119
}
120120

121121
if (0 != intl_get_error_code()) {
122+
var_dump($value);
123+
var_dump($this->dateFormat);
124+
var_dump($this->timeFormat);
125+
var_dump($this->calendar);
126+
var_dump($this->pattern);
127+
var_dump(\Locale::getDefault());
128+
122129
throw new TransformationFailedException(intl_get_error_message(), intl_get_error_code());
123130
} elseif ($timestamp > 253402214400) {
124131
// This timestamp represents UTC midnight of 9999-12-31 to prevent 5+ digit years

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
1515
use Symfony\Component\Form\Exception\LogicException;
16+
use Symfony\Component\Form\Exception\TransformationFailedException;
1617
use Symfony\Component\Form\FormError;
1718
use Symfony\Component\Form\FormInterface;
19+
use Symfony\Component\Intl\Intl;
1820
use Symfony\Component\Intl\Util\IntlTestHelper;
1921
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
2022

@@ -90,7 +92,7 @@ public function testSubmitFromSingleTextDateTimeWithCustomFormat()
9092
public function testSubmitFromSingleTextDateTime()
9193
{
9294
// we test against "de_DE", so we need the full implementation
93-
IntlTestHelper::requireFullIntl($this, false);
95+
IntlTestHelper::requireFullIntl($this, false, true);
9496

9597
\Locale::setDefault('de_DE');
9698

@@ -105,6 +107,17 @@ public function testSubmitFromSingleTextDateTime()
105107

106108
$form->submit('2.6.2010');
107109

110+
if (!$form->isValid()) {
111+
var_dump(Intl::getIcuVersion());
112+
/** @var FormError $error */
113+
foreach ($form->getErrors(true) as $error) {
114+
var_dump($error->getMessage());
115+
var_dump($error->getCause()->getMessage());
116+
var_dump($error->getCause()->getInvalidMessage());
117+
var_dump($error->getCause()->getInvalidMessageParameters());
118+
}
119+
}
120+
108121
$this->assertEquals(new \DateTime('2010-06-02 UTC'), $form->getData());
109122
$this->assertEquals('02.06.2010', $form->getViewData());
110123
}

src/Symfony/Component/Intl/Util/IntlTestHelper.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ class IntlTestHelper
3030
/**
3131
* Should be called before tests that work fine with the stub implementation.
3232
*/
33-
public static function requireIntl(TestCase $testCase, string $minimumIcuVersion = null): void
33+
public static function requireIntl(TestCase $testCase, string $minimumIcuVersion = null, bool $debug = false): void
3434
{
35+
if ($debug) {
36+
var_dump(__METHOD__);
37+
var_dump($minimumIcuVersion);
38+
}
3539
$minimumIcuVersion ??= Intl::getIcuStubVersion();
40+
if ($debug) {
41+
var_dump($minimumIcuVersion);
42+
}
3643

3744
// We only run tests if the version is *one specific version*.
3845
// This condition is satisfied if
@@ -62,14 +69,18 @@ public static function requireIntl(TestCase $testCase, string $minimumIcuVersion
6269
* Should be called before tests that require a feature-complete intl
6370
* implementation.
6471
*/
65-
public static function requireFullIntl(TestCase $testCase, string $minimumIcuVersion = null): void
72+
public static function requireFullIntl(TestCase $testCase, string $minimumIcuVersion = null, bool $debug = false): void
6673
{
74+
if ($debug) {
75+
var_dump(__METHOD__);
76+
var_dump($minimumIcuVersion);
77+
}
6778
// We only run tests if the intl extension is loaded...
6879
if (!Intl::isExtensionLoaded()) {
6980
$testCase->markTestSkipped('Extension intl is required.');
7081
}
7182

72-
self::requireIntl($testCase, $minimumIcuVersion);
83+
self::requireIntl($testCase, $minimumIcuVersion, $debug);
7384

7485
// Consequently, tests will
7586
//

0 commit comments

Comments
 (0)
0