|
| 1 | +<?php |
| 2 | +/************************************************************************ |
| 3 | + * |
| 4 | + * Copyright 2024 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + * |
| 7 | + * NOTICE: All information contained herein is, and remains |
| 8 | + * the property of Adobe and its suppliers, if any. The intellectual |
| 9 | + * and technical concepts contained herein are proprietary to Adobe |
| 10 | + * and its suppliers and are protected by all applicable intellectual |
| 11 | + * property laws, including trade secret and copyright laws. |
| 12 | + * Dissemination of this information or reproduction of this material |
| 13 | + * is strictly forbidden unless prior written permission is obtained |
| 14 | + * from Adobe. |
| 15 | + * ************************************************************************ |
| 16 | + */ |
| 17 | +declare(strict_types=1); |
| 18 | + |
| 19 | +namespace Magento\Sales\Controller\Adminhtml\Order; |
| 20 | + |
| 21 | +use Magento\Framework\Exception\LocalizedException; |
| 22 | +use Magento\Sales\Api\Data\OrderInterfaceFactory; |
| 23 | +use Magento\TestFramework\TestCase\AbstractBackendController; |
| 24 | + |
| 25 | +class ViewCommentTest extends AbstractBackendController |
| 26 | +{ |
| 27 | + /** @var OrderInterfaceFactory */ |
| 28 | + private $orderFactory; |
| 29 | + |
| 30 | + /** |
| 31 | + * @inheritdoc |
| 32 | + */ |
| 33 | + protected function setUp(): void |
| 34 | + { |
| 35 | + parent::setUp(); |
| 36 | + $this->orderFactory = $this->_objectManager->get(OrderInterfaceFactory::class); |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * Verify the button Label is rendered as 'Update Changes' in order comment section |
| 41 | + * of order details page. |
| 42 | + * |
| 43 | + * @magentoDataFixture Magento/Sales/_files/order.php |
| 44 | + * @magentoAppArea adminhtml |
| 45 | + * @return void |
| 46 | + * @throws LocalizedException |
| 47 | + */ |
| 48 | + public function testVerifyStatusCommentUpdateButtonLabel(): void |
| 49 | + { |
| 50 | + $order = $this->orderFactory->create()->loadByIncrementId('100000001'); |
| 51 | + $this->getRequest()->setParam('order_id', $order->getEntityId()); |
| 52 | + $this->dispatch('backend/sales/order/view/'); |
| 53 | + $content = $this->getResponse()->getBody(); |
| 54 | + $this->assertStringContainsString( |
| 55 | + '<span>Update</span>', |
| 56 | + $content |
| 57 | + ); |
| 58 | + } |
| 59 | +} |
0 commit comments