Skip to content

Commit 02bb63a

Browse files
authored
Merge pull request #6035 from magento-tsg/2.4.1-develop-pr77
[TSG-Commerce] Fixes for 2.4 (pr77) (2.4.1-develop)
2 parents e110238 + 66c0117 commit 02bb63a

File tree

3 files changed

+50
-16
lines changed

3 files changed

+50
-16
lines changed

app/code/Magento/TaxImportExport/view/adminhtml/templates/importExport.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ script;
7474
<div class="fieldset admin__field">
7575
<span class="admin__field-label"><span><?= $block->escapeHtml(__('Export Tax Rates')) ?></span></span>
7676
<div class="admin__field-control">
77-
<?= $block->getButtonHtml(__('Export Tax Rates'), "this.form.submit()") ?>
77+
<?= $block->getButtonHtml(__('Export Tax Rates'), "export_form.submit()") ?>
7878
</div>
7979
</div>
8080
<?php if ($block->getUseContainer()):?>

dev/tests/integration/testsuite/Magento/TaxImportExport/Block/Adminhtml/Rate/ImportExportTest.php

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,74 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\TaxImportExport\Block\Adminhtml\Rate;
79

8-
class ImportExportTest extends \PHPUnit\Framework\TestCase
10+
use Magento\Framework\ObjectManagerInterface;
11+
use Magento\Framework\View\LayoutInterface;
12+
use Magento\TestFramework\Helper\Bootstrap;
13+
use PHPUnit\Framework\TestCase;
14+
15+
/**
16+
* Tests for Tax Rate Import/Export form.
17+
*
18+
* @magentoAppArea adminhtml
19+
*/
20+
class ImportExportTest extends TestCase
921
{
1022
/**
11-
* @var \Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport
23+
* @var ObjectManagerInterface
1224
*/
13-
protected $_block = null;
25+
private $objectManager;
1426

27+
/**
28+
* @var ImportExport
29+
*/
30+
protected $block = null;
31+
32+
/**
33+
* @inheritdoc
34+
*/
1535
protected function setUp(): void
1636
{
17-
\Magento\TestFramework\Helper\Bootstrap::getInstance()
18-
->loadArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE);
19-
$this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
20-
\Magento\Framework\View\LayoutInterface::class
21-
)->createBlock(\Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport::class);
37+
$this->objectManager = Bootstrap::getObjectManager();
38+
$this->block = $this->objectManager->get(LayoutInterface::class)->createBlock(ImportExport::class);
2239
}
2340

41+
/**
42+
* @inheritdoc
43+
*/
2444
protected function tearDown(): void
2545
{
26-
$this->_block = null;
46+
$this->block = null;
2747
}
2848

29-
public function testCreateBlock()
49+
/**
50+
* @return void
51+
*/
52+
public function testCreateBlock(): void
3053
{
31-
$this->assertInstanceOf(\Magento\TaxImportExport\Block\Adminhtml\Rate\ImportExport::class, $this->_block);
54+
$this->assertInstanceOf(ImportExport::class, $this->block);
3255
}
3356

34-
public function testFormExists()
57+
/**
58+
* @return void
59+
*/
60+
public function testFormExists(): void
3561
{
36-
$html = $this->_block->toHtml();
37-
62+
$html = $this->block->toHtml();
3863
$this->assertStringContainsString('<form id="import-form"', $html);
64+
$this->assertStringContainsString('<form id="export_form"', $html);
65+
}
3966

67+
/**
68+
* @return void
69+
*/
70+
public function testExportFormButtonOnClick(): void
71+
{
72+
$html = $this->block->toHtml();
4073
$this->assertStringContainsString('<form id="export_form"', $html);
74+
$this->assertStringContainsString('export_form.submit();', $html);
4175
}
4276
}

lib/internal/Magento/Framework/Data/Form/Element/Time.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function getElementHtml()
115115
[],
116116
<<<style
117117
.select80wide {
118-
width: 80px;
118+
width: 80px !important;
119119
}
120120
style
121121
,

0 commit comments

Comments
 (0)