1414use Magento \Customer \Api \Data \CustomerInterfaceFactory ;
1515use Magento \Customer \Model \Customer ;
1616use Magento \Customer \Model \CustomerRegistry ;
17+ use Magento \Customer \Test \Fixture \Customer as CustomerFixture ;
1718use Magento \Framework \Api \DataObjectHelper ;
1819use Magento \Framework \Api \ExtensibleDataObjectConverter ;
1920use Magento \Framework \Api \FilterBuilder ;
2728use Magento \Framework \Validator \Exception as ValidatorException ;
2829use Magento \Sales \Api \Data \OrderInterface ;
2930use Magento \Sales \Api \OrderRepositoryInterface ;
30- use Magento \TestFramework \Helper \Bootstrap ;
31- use Magento \TestFramework \Fixture \Config as ConfigFixture ;
3231use Magento \TestFramework \Fixture \DataFixture ;
3332use Magento \TestFramework \Fixture \DataFixtureStorage ;
3433use Magento \TestFramework \Fixture \DataFixtureStorageManager ;
34+ use Magento \TestFramework \Helper \Bootstrap ;
3535
3636/**
3737 * Checks Customer insert, update, search with repository
@@ -73,6 +73,11 @@ class CustomerRepositoryTest extends \PHPUnit\Framework\TestCase
7373 /** @var CustomerRegistry */
7474 protected $ customerRegistry ;
7575
76+ /**
77+ * @var DataFixtureStorage
78+ */
79+ private $ fixtures ;
80+
7681 /**
7782 * @inheritdoc
7883 */
@@ -88,6 +93,7 @@ protected function setUp(): void
8893 $ this ->dataObjectHelper = $ this ->objectManager ->create (DataObjectHelper::class);
8994 $ this ->encryptor = $ this ->objectManager ->create (EncryptorInterface::class);
9095 $ this ->customerRegistry = $ this ->objectManager ->create (CustomerRegistry::class);
96+ $ this ->fixtures = DataFixtureStorageManager::getStorage ();
9197
9298 /** @var CacheInterface $cache */
9399 $ cache = $ this ->objectManager ->create (CacheInterface::class);
@@ -732,4 +738,21 @@ public function testSaveCustomerWithInvalidAttrValue(): void
732738 $ this ->expectExceptionMessage ('Attribute gender does not contain option with Id 123 ' );
733739 $ this ->customerRepository ->save ($ customer );
734740 }
741+
742+ #[
743+ DataFixture(
744+ CustomerFixture::class,
745+ [
746+ 'email ' => 'émâíl123@example.com ' ,
747+ 'rp_token ' => 'random_token_123 '
748+ ],
749+ as: 'customer '
750+ )
751+ ]
752+ public function testSaveCustomerWithEmailWithDiacritics (): void
753+ {
754+ $ customer = $ this ->fixtures ->get ('customer ' );
755+ $ this ->assertEquals ('émâíl123@example.com ' , $ customer ->getEmail ());
756+ $ this ->assertNotEquals ('random_token_123 ' , $ customer ->getRpToken ());
757+ }
735758}
0 commit comments