Skip to content

Commit 99d9d4b

Browse files
committed
MC-37100: Create automated test for "Create customer, when admin interface locale is en_GB"
1 parent e151888 commit 99d9d4b

File tree

1 file changed

+6
-4
lines changed
  • dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index

1 file changed

+6
-4
lines changed

dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/SaveTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
namespace Magento\Customer\Controller\Adminhtml\Index;
99

1010
use Magento\Backend\Model\Session;
11+
use Magento\Customer\Api\CustomerMetadataInterface;
1112
use Magento\Customer\Api\CustomerNameGenerationInterface;
1213
use Magento\Customer\Api\CustomerRepositoryInterface;
1314
use Magento\Customer\Api\Data\CustomerInterface;
1415
use Magento\Customer\Model\Data\Customer as CustomerData;
1516
use Magento\Customer\Model\EmailNotification;
17+
use Magento\Eav\Api\AttributeRepositoryInterface;
1618
use Magento\Framework\App\Area;
1719
use Magento\Framework\App\Request\Http as HttpRequest;
1820
use Magento\Framework\Locale\ResolverInterface;
@@ -23,6 +25,7 @@
2325
use Magento\Newsletter\Model\SubscriberFactory;
2426
use Magento\Store\Model\Store;
2527
use Magento\Store\Model\StoreManagerInterface;
28+
use Magento\TestFramework\Helper\Bootstrap;
2629
use Magento\TestFramework\TestCase\AbstractBackendController;
2730
use PHPUnit\Framework\MockObject\MockObject;
2831

@@ -458,14 +461,13 @@ public function testCreateCustomerByAdminWithLocaleGB(): void
458461
[
459462
'customer' => [
460463
CustomerData::DOB => '1990-10-24',
461-
CustomerData::GENDER => '0',
462464
],
463465
]
464466
);
465467
unset($expectedData['customer']['sendemail_store_id']);
466468
$this->dispatchCustomerSave($postData);
467469
$this->assertSessionMessages(
468-
$this->equalTo([(string)__('You saved the customer.')]),
470+
$this->containsEqual((string)__('You saved the customer.')),
469471
MessageInterface::TYPE_SUCCESS
470472
);
471473
$this->assertRedirect($this->stringContains($this->baseControllerUrl . 'index/key/'));
@@ -496,7 +498,8 @@ private function getDefaultCustomerData(): array
496498
CustomerData::EMAIL => 'janedoe' . uniqid() . '@example.com',
497499
CustomerData::DOB => '01/01/2000',
498500
CustomerData::TAXVAT => '121212',
499-
CustomerData::GENDER => 'Male',
501+
CustomerData::GENDER => Bootstrap::getObjectManager()->get(AttributeRepositoryInterface::class)
502+
->get(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, 'gender')->getSource()->getOptionId('Male'),
500503
'sendemail_store_id' => '1',
501504
]
502505
];
@@ -516,7 +519,6 @@ private function getExpectedCustomerData(array $defaultCustomerData): array
516519
[
517520
'customer' => [
518521
CustomerData::DOB => '2000-01-01',
519-
CustomerData::GENDER => '0',
520522
CustomerData::STORE_ID => 1,
521523
CustomerData::CREATED_IN => 'Default Store View',
522524
],

0 commit comments

Comments
 (0)