Skip to content

Commit a07835a

Browse files
author
olysenko
committed
MAGETWO-93188: Product date attribute: An error displays for default date greater than 12 with local using dd/mm/yyyy
1 parent e558dca commit a07835a

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

app/code/Magento/Captcha/Test/Unit/Model/Customer/Plugin/AjaxLoginTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class AjaxLoginTest extends \PHPUnit\Framework\TestCase
5858
*/
5959
protected $model;
6060

61+
/**
62+
* @inheritdoc
63+
*/
6164
protected function setUp()
6265
{
6366
$this->sessionManagerMock = $this->createPartialMock(\Magento\Checkout\Model\Session::class, ['setUsername']);
@@ -91,6 +94,9 @@ protected function setUp()
9194
);
9295
}
9396

97+
/**
98+
* Test aroundExecute.
99+
*/
94100
public function testAroundExecute()
95101
{
96102
$username = 'name';
@@ -123,6 +129,9 @@ public function testAroundExecute()
123129
$this->assertEquals('result', $this->model->aroundExecute($this->loginControllerMock, $closure));
124130
}
125131

132+
/**
133+
* Test aroundExecuteIncorrectCaptcha.
134+
*/
126135
public function testAroundExecuteIncorrectCaptcha()
127136
{
128137
$username = 'name';

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Helper
104104
* @param \Magento\Backend\Helper\Js $jsHelper
105105
* @param \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter
106106
* @param CustomOptionFactory|null $customOptionFactory
107-
* @param ProductLinkFactory |null $productLinkFactory
107+
* @param ProductLinkFactory|null $productLinkFactory
108108
* @param ProductRepositoryInterface|null $productRepository
109109
* @param LinkTypeProvider|null $linkTypeProvider
110110
* @param AttributeFilter|null $attributeFilter

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ class HelperTest extends \PHPUnit\Framework\TestCase
9595
*/
9696
protected $attributeFilterMock;
9797

98+
/**
99+
* @inheritdoc
100+
*/
98101
protected function setUp()
99102
{
100103
$this->objectManager = new ObjectManager($this);

app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class ImageTest extends \PHPUnit\Framework\TestCase
3434
*/
3535
private $filesystem;
3636

37+
/**
38+
* @inheritdoc
39+
*/
3740
protected function setUp()
3841
{
3942
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -138,6 +141,9 @@ public function testBeforeSaveValueInvalid($value)
138141
$this->assertEquals('', $object->getTestAttribute());
139142
}
140143

144+
/**
145+
* Test beforeSaveAttributeFileName.
146+
*/
141147
public function testBeforeSaveAttributeFileName()
142148
{
143149
$model = $this->objectManager->getObject(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class);
@@ -154,6 +160,9 @@ public function testBeforeSaveAttributeFileName()
154160
$this->assertEquals('test123.jpg', $object->getTestAttribute());
155161
}
156162

163+
/**
164+
* Test beforeSaveAttributeFileNameOutsideOfCategoryDir.
165+
*/
157166
public function testBeforeSaveAttributeFileNameOutsideOfCategoryDir()
158167
{
159168
$model = $this->objectManager->getObject(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class, [
@@ -186,6 +195,9 @@ public function testBeforeSaveAttributeFileNameOutsideOfCategoryDir()
186195
);
187196
}
188197

198+
/**
199+
* Test beforeSaveTemporaryAttribute.
200+
*/
189201
public function testBeforeSaveTemporaryAttribute()
190202
{
191203
$model = $this->objectManager->getObject(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class);
@@ -204,6 +216,9 @@ public function testBeforeSaveTemporaryAttribute()
204216
], $object->getData('_additional_data_test_attribute'));
205217
}
206218

219+
/**
220+
* Test beforeSaveAttributeStringValue.
221+
*/
207222
public function testBeforeSaveAttributeStringValue()
208223
{
209224
$model = $this->objectManager->getObject(\Magento\Catalog\Model\Category\Attribute\Backend\Image::class);
@@ -304,6 +319,9 @@ public function testAfterSaveWithoutAdditionalData($value)
304319
$model->afterSave($object);
305320
}
306321

322+
/**
323+
* Test afterSaveWithExceptions.
324+
*/
307325
public function testAfterSaveWithExceptions()
308326
{
309327
$model = $this->setUpModelForAfterSave();

dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,19 @@ class AttributeTest extends \PHPUnit\Framework\TestCase
2828
*/
2929
private $_localeResolver;
3030

31+
/**
32+
* {@inheritdoc}
33+
*/
3134
protected function setUp()
3235
{
3336
$this->objectManager = Bootstrap::getObjectManager();
3437
$this->attribute = $this->objectManager->get(Attribute::class);
3538
$this->_localeResolver = $this->objectManager->get(ResolverInterface::class);
3639
}
3740

41+
/**
42+
* {@inheritdoc}
43+
*/
3844
protected function tearDown()
3945
{
4046
$this->attribute = null;
@@ -60,6 +66,11 @@ public function testBeforeSave($defaultValue, $backendType, $locale, $expected)
6066
$this->assertEquals($expected, $this->attribute->getDefaultValue());
6167
}
6268

69+
/**
70+
* Data provider for beforeSaveData.
71+
*
72+
* @return array
73+
*/
6374
public function beforeSaveDataProvider()
6475
{
6576
return [
@@ -91,6 +102,11 @@ public function testBeforeSaveErrorData($defaultValue, $backendType, $locale, $e
91102
$this->expectExceptionMessage($expected);
92103
}
93104

105+
/**
106+
* Data provider for beforeSaveData with error result.
107+
*
108+
* @return array
109+
*/
94110
public function beforeSaveErrorDataDataProvider()
95111
{
96112
return [

0 commit comments

Comments
 (0)