From 31353147a3345fcb100630bb0b4f7ff1d98f47a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= Date: Sun, 8 Jul 2018 17:43:47 -1000 Subject: [PATCH 1/3] Use an empty string as default for assertEquals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure it isn’t interpreted as a type NULL, making the test fail with PHPUnit 7.2. --- .../ClassLoader/Tests/ClassMapGeneratorTest.php | 2 +- .../Component/DomCrawler/Tests/CrawlerTest.php | 2 +- .../Component/Stopwatch/Tests/StopwatchEventTest.php | 12 ++++++------ .../Component/Stopwatch/Tests/StopwatchTest.php | 2 +- .../Yaml/Tests/Fixtures/escapedCharacters.yml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php index 69b1e61594..ad6a1b86ff 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php @@ -138,7 +138,7 @@ class ClassMapGeneratorTest extends TestCase ), ClassMapGenerator::createMap($finder)); } - protected function assertEqualsNormalized($expected, $actual, $message = null) + protected function assertEqualsNormalized($expected, $actual, $message = '') { foreach ($expected as $ns => $path) { $expected[$ns] = str_replace('\\', '/', $path); diff --git a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php index a8dc525e55..9b2d124194 100644 --- a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php @@ -1027,7 +1027,7 @@ HTML; /** * @dataProvider getBaseTagData */ - public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = null) + public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = '') { $crawler = new Crawler('', $currentUri); $this->assertEquals($expectedUri, $crawler->filterXPath('//a')->link()->getUri(), $description); diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php index f2ee039797..2742ca544a 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php @@ -73,7 +73,7 @@ class StopwatchEventTest extends TestCase $event->start(); usleep(200000); $event->stop(); - $this->assertEquals(200, $event->getDuration(), null, self::DELTA); + $this->assertEquals(200, $event->getDuration(), '', self::DELTA); $event = new StopwatchEvent(microtime(true) * 1000); $event->start(); @@ -83,7 +83,7 @@ class StopwatchEventTest extends TestCase $event->start(); usleep(100000); $event->stop(); - $this->assertEquals(200, $event->getDuration(), null, self::DELTA); + $this->assertEquals(200, $event->getDuration(), '', self::DELTA); } public function testDurationBeforeStop() @@ -91,7 +91,7 @@ class StopwatchEventTest extends TestCase $event = new StopwatchEvent(microtime(true) * 1000); $event->start(); usleep(200000); - $this->assertEquals(200, $event->getDuration(), null, self::DELTA); + $this->assertEquals(200, $event->getDuration(), '', self::DELTA); $event = new StopwatchEvent(microtime(true) * 1000); $event->start(); @@ -100,7 +100,7 @@ class StopwatchEventTest extends TestCase usleep(50000); $event->start(); usleep(100000); - $this->assertEquals(100, $event->getDuration(), null, self::DELTA); + $this->assertEquals(100, $event->getDuration(), '', self::DELTA); } /** @@ -134,7 +134,7 @@ class StopwatchEventTest extends TestCase $event->start(); usleep(100000); $event->ensureStopped(); - $this->assertEquals(300, $event->getDuration(), null, self::DELTA); + $this->assertEquals(300, $event->getDuration(), '', self::DELTA); } public function testStartTime() @@ -151,7 +151,7 @@ class StopwatchEventTest extends TestCase $event->start(); usleep(100000); $event->stop(); - $this->assertEquals(0, $event->getStartTime(), null, self::DELTA); + $this->assertEquals(0, $event->getStartTime(), '', self::DELTA); } /** diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php index a63b54d6a2..10e6a14af6 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php @@ -79,7 +79,7 @@ class StopwatchTest extends TestCase $event = $stopwatch->stop('foo'); $this->assertInstanceOf('Symfony\Component\Stopwatch\StopwatchEvent', $event); - $this->assertEquals(200, $event->getDuration(), null, self::DELTA); + $this->assertEquals(200, $event->getDuration(), '', self::DELTA); } /** diff --git a/src/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml b/src/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml index 6ca044c8da..cc0356d36a 100644 --- a/src/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml +++ b/src/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml @@ -4,7 +4,7 @@ yaml: | php: | "\\0 \\ \\a \\b \\n" --- -test: null +test: 'null' yaml: | "\0" php: | From b7d55ede157c206e5e0c9355fcc30b5c16bdc6e2 Mon Sep 17 00:00:00 2001 From: Oleksii Zhurbytskyi Date: Mon, 23 Jul 2018 13:56:58 +0300 Subject: [PATCH 2/3] Add missing Ukrainian translations --- .../Resources/translations/validators.uk.xlf | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf index 1a734710a6..6a92801c9b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.uk.xlf @@ -278,6 +278,42 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Значення не повинно бути ідентичним {{ compared_value_type }} {{ compared_value }}. + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Співвідношення сторін зображення занадто велике ({{ ratio }}). Максимальне співвідношення сторін {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Співвідношення сторін зображення занадто мало ({{ ratio }}). Мінімальне співвідношення сторін {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Зображення квадратне ({{ width }}x{{ height }}px). Квадратні зображення не дозволені. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Зображення альбомної орієнтації ({{ width }}x{{ height }}px). Зображення альбомної орієнтації не дозволені. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Зображення в портретній орієнтації ({{ width }}x{{ height }}px). Зображення в портретної орієнтації не дозволені. + + + An empty file is not allowed. + Порожні файли не дозволені. + + + The host could not be resolved. + Ім'я хоста не знайдено. + + + This value does not match the expected {{ charset }} charset. + Значення не збігається з очікуваним {{ charset }} кодуванням. + + + This is not a valid Business Identifier Code (BIC). + Це не дійсний банківський код (BIC). + Error Помилка From bf7e25f759821bbca6c2926047f44fa45bed3ac7 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 26 Jul 2018 12:58:07 +0200 Subject: [PATCH 3/3] Fix tests for legacy phpunit versions --- src/Symfony/Component/Form/FormInterface.php | 2 +- src/Symfony/Component/HttpKernel/Profiler/Profile.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Form/FormInterface.php b/src/Symfony/Component/Form/FormInterface.php index 92e4cba377..253f28dd7a 100644 --- a/src/Symfony/Component/Form/FormInterface.php +++ b/src/Symfony/Component/Form/FormInterface.php @@ -29,7 +29,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable * @throws Exception\LogicException when trying to set a parent for a form with * an empty name */ - public function setParent(self $parent = null); + public function setParent(FormInterface $parent = null); /** * Returns the parent form. diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profile.php b/src/Symfony/Component/HttpKernel/Profiler/Profile.php index 490f406e26..c21c9d38a3 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profile.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profile.php @@ -74,7 +74,7 @@ class Profile /** * Sets the parent token. */ - public function setParent(self $parent) + public function setParent(Profile $parent) { $this->parent = $parent; } @@ -213,7 +213,7 @@ class Profile /** * Adds the child token. */ - public function addChild(self $child) + public function addChild(Profile $child) { $this->children[] = $child; $child->setParent($this);