|
| 1 | +<?php |
| 2 | +/************************************************************************ |
| 3 | + * Copyright 2024 Adobe |
| 4 | + * All Rights Reserved. |
| 5 | + * |
| 6 | + * NOTICE: All information contained herein is, and remains |
| 7 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 8 | + * and technical concepts contained herein are proprietary to Adobe |
| 9 | + * and its suppliers and are protected by all applicable intellectual |
| 10 | + * property laws, including trade secret and copyright laws. |
| 11 | + * Dissemination of this information or reproduction of this material |
| 12 | + * is strictly forbidden unless prior written permission is obtained |
| 13 | + * from Adobe. |
| 14 | + * *********************************************************************** |
| 15 | + */ |
| 16 | +declare(strict_types=1); |
| 17 | + |
| 18 | +namespace Magento\CustomerImportExport\Test\Unit\Plugin\Model\Export; |
| 19 | + |
| 20 | +use Magento\CustomerImportExport\Plugin\Model\Export\FormatCustomerCreatedAt; |
| 21 | +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; |
| 22 | +use PHPUnit\Framework\MockObject\MockObject; |
| 23 | +use Magento\CustomerImportExport\Model\Export\Customer; |
| 24 | +use Magento\Customer\Model\Customer as Item; |
| 25 | +use PHPUnit\Framework\TestCase; |
| 26 | + |
| 27 | +class FormatCustomerCreatedAtTest extends TestCase |
| 28 | +{ |
| 29 | + /** |
| 30 | + * @var Customer|MockObject |
| 31 | + */ |
| 32 | + private $subjectMock; |
| 33 | + |
| 34 | + /** |
| 35 | + * @var Item|MockObject |
| 36 | + */ |
| 37 | + private $itemMock; |
| 38 | + |
| 39 | + /** |
| 40 | + * Format customer createdAt plugin model |
| 41 | + * |
| 42 | + * @var FormatCustomerCreatedAt |
| 43 | + */ |
| 44 | + private $model; |
| 45 | + |
| 46 | + protected function setUp(): void |
| 47 | + { |
| 48 | + $timeZone = $this->getMockForAbstractClass(TimezoneInterface::class); |
| 49 | + $this->subjectMock = $this->getMockBuilder(Customer::class) |
| 50 | + ->disableOriginalConstructor() |
| 51 | + ->getMock(); |
| 52 | + $this->itemMock = $this->getMockBuilder(Item::class) |
| 53 | + ->disableOriginalConstructor() |
| 54 | + ->getMock(); |
| 55 | + $this->model = new FormatCustomerCreatedAt( |
| 56 | + $timeZone |
| 57 | + ); |
| 58 | + } |
| 59 | + |
| 60 | + public function testBeforeExportIte() |
| 61 | + { |
| 62 | + $this->model->beforeExportItem( |
| 63 | + $this->subjectMock, |
| 64 | + $this->itemMock |
| 65 | + ); |
| 66 | + } |
| 67 | +} |
0 commit comments