From a484482409e6bb99a79fe3a3cbf1bfceb5959de2 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <smankivskyi@ebay.com> Date: Mon, 16 Mar 2015 18:40:38 +0200 Subject: [PATCH] MAGETWO-35064: At night (by Kiev time) some tests connected to dates are failed --- app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php | 5 +++-- .../Customer/Test/Unit/Controller/Account/EditPostTest.php | 4 ++-- lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php | 2 +- .../Magento/Framework/Stdlib/DateTime/TimezoneInterface.php | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php b/app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php index bc5499166cd..e844d62b7d8 100644 --- a/app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Helper/DataTest.php @@ -123,8 +123,9 @@ class DataTest extends \PHPUnit_Framework_TestCase ); $this->_checkoutSession = $arguments['checkoutSession']; - $localeDate = $arguments['localeDate']; - $localeDate->expects($this->any())->method('date')->will($this->returnValue('Oct 02, 2013')); + $arguments['localeDate']->expects($this->any()) + ->method('formatDateTime') + ->willReturn('Oct 02, 2013'); $this->_transportBuilder = $arguments['transportBuilder']; diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/EditPostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/EditPostTest.php index fe474d3c814..86113cef969 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/EditPostTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/EditPostTest.php @@ -252,13 +252,13 @@ class EditPostTest extends \PHPUnit_Framework_TestCase $this->customerAccountManagement ->expects($this->once()) ->method('changePassword') - ->willThrowException(new \Magento\Framework\Exception\AuthenticationException('Error')); + ->willThrowException(new \Magento\Framework\Exception\AuthenticationException(__('Error'))); $this->messageManager ->expects($this->once()) ->method('addError') ->with('Error'); - $exception = new \Magento\Framework\Exception\InputException('Error'); + $exception = new \Magento\Framework\Exception\InputException(__('Error')); $this->customerRepository ->expects($this->once()) ->method('save') diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php index 2bd6553b4fb..ab75ed3fd33 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/Timezone.php @@ -233,7 +233,7 @@ class Timezone implements TimezoneInterface * @param null $locale * @param null $timezone * @param string|null $pattern - * @return mixed + * @return string */ public function formatDateTime( \DateTimeInterface $date, diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php b/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php index 48bbbc73796..75c865b542a 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php @@ -122,7 +122,7 @@ interface TimezoneInterface * @param null $locale * @param null $timezone * @param string|null $pattern - * @return mixed + * @return string */ public function formatDateTime( \DateTimeInterface $date, -- GitLab