|
23 | 23 | use Magento\Framework\View\Element\Html\Date;
|
24 | 24 | use Magento\Framework\View\Element\Template\Context;
|
25 | 25 | use PHPUnit\Framework\TestCase;
|
26 |
| -use PHPUnit_Framework_MockObject_MockObject; |
| 26 | +use PHPUnit\Framework\MockObject\MockObject; |
27 | 27 | use Zend_Cache_Backend_BlackHole;
|
28 | 28 | use Zend_Cache_Core;
|
29 | 29 |
|
@@ -60,17 +60,17 @@ class DobTest extends TestCase
|
60 | 60 | const YEAR_HTML =
|
61 | 61 | '<div><label for="year"><span>yy</span></label><input type="text" id="year" name="Year" value="14"></div>';
|
62 | 62 |
|
63 |
| - /** @var PHPUnit_Framework_MockObject_MockObject|AttributeMetadataInterface */ |
| 63 | + /** @var MockObject|AttributeMetadataInterface */ |
64 | 64 | protected $attribute;
|
65 | 65 |
|
66 | 66 | /** @var Dob */
|
67 | 67 | protected $_block;
|
68 | 68 |
|
69 |
| - /** @var PHPUnit_Framework_MockObject_MockObject|CustomerMetadataInterface */ |
| 69 | + /** @var MockObject|CustomerMetadataInterface */ |
70 | 70 | protected $customerMetadata;
|
71 | 71 |
|
72 | 72 | /**
|
73 |
| - * @var FilterFactory|PHPUnit_Framework_MockObject_MockObject |
| 73 | + * @var FilterFactory|MockObject |
74 | 74 | */
|
75 | 75 | protected $filterFactory;
|
76 | 76 |
|
@@ -336,12 +336,27 @@ public function getYearDataProvider()
|
336 | 336 | }
|
337 | 337 |
|
338 | 338 | /**
|
339 |
| - * is used to derive the Locale that is used to determine the |
340 |
| - * value of Dob::getDateFormat() for that Locale. |
| 339 | + * Is used to derive the Locale that is used to determine the value of Dob::getDateFormat() for that Locale |
| 340 | + * |
| 341 | + * @param string $locale |
| 342 | + * @param string $expectedFormat |
| 343 | + * @dataProvider getDateFormatDataProvider |
341 | 344 | */
|
342 |
| - public function testGetDateFormat() |
| 345 | + public function testGetDateFormat(string $locale, string $expectedFormat) |
343 | 346 | {
|
344 |
| - $this->assertEquals(self::DATE_FORMAT, $this->_block->getDateFormat()); |
| 347 | + $this->_locale = $locale; |
| 348 | + $this->assertEquals($expectedFormat, $this->_block->getDateFormat()); |
| 349 | + } |
| 350 | + |
| 351 | + /** |
| 352 | + * @return array |
| 353 | + */ |
| 354 | + public function getDateFormatDataProvider(): array |
| 355 | + { |
| 356 | + return [ |
| 357 | + ['ar_SA', 'd/M/y'], |
| 358 | + [Resolver::DEFAULT_LOCALE, self::DATE_FORMAT], |
| 359 | + ]; |
345 | 360 | }
|
346 | 361 |
|
347 | 362 | /**
|
|
0 commit comments