14
14
use Magento \Customer \Api \Data \CustomerInterfaceFactory ;
15
15
use Magento \Customer \Model \Customer ;
16
16
use Magento \Customer \Model \CustomerRegistry ;
17
+ use Magento \Customer \Test \Fixture \Customer as CustomerFixture ;
17
18
use Magento \Framework \Api \DataObjectHelper ;
18
19
use Magento \Framework \Api \ExtensibleDataObjectConverter ;
19
20
use Magento \Framework \Api \FilterBuilder ;
27
28
use Magento \Framework \Validator \Exception as ValidatorException ;
28
29
use Magento \Sales \Api \Data \OrderInterface ;
29
30
use Magento \Sales \Api \OrderRepositoryInterface ;
30
- use Magento \TestFramework \Helper \Bootstrap ;
31
- use Magento \TestFramework \Fixture \Config as ConfigFixture ;
32
31
use Magento \TestFramework \Fixture \DataFixture ;
33
32
use Magento \TestFramework \Fixture \DataFixtureStorage ;
34
33
use Magento \TestFramework \Fixture \DataFixtureStorageManager ;
34
+ use Magento \TestFramework \Helper \Bootstrap ;
35
35
36
36
/**
37
37
* Checks Customer insert, update, search with repository
@@ -73,6 +73,11 @@ class CustomerRepositoryTest extends \PHPUnit\Framework\TestCase
73
73
/** @var CustomerRegistry */
74
74
protected $ customerRegistry ;
75
75
76
+ /**
77
+ * @var DataFixtureStorage
78
+ */
79
+ private $ fixtures ;
80
+
76
81
/**
77
82
* @inheritdoc
78
83
*/
@@ -88,6 +93,7 @@ protected function setUp(): void
88
93
$ this ->dataObjectHelper = $ this ->objectManager ->create (DataObjectHelper::class);
89
94
$ this ->encryptor = $ this ->objectManager ->create (EncryptorInterface::class);
90
95
$ this ->customerRegistry = $ this ->objectManager ->create (CustomerRegistry::class);
96
+ $ this ->fixtures = DataFixtureStorageManager::getStorage ();
91
97
92
98
/** @var CacheInterface $cache */
93
99
$ cache = $ this ->objectManager ->create (CacheInterface::class);
@@ -732,4 +738,21 @@ public function testSaveCustomerWithInvalidAttrValue(): void
732
738
$ this ->expectExceptionMessage ('Attribute gender does not contain option with Id 123 ' );
733
739
$ this ->customerRepository ->save ($ customer );
734
740
}
741
+
742
+ #[
743
+ DataFixture(
744
+ CustomerFixture::class,
745
+ [
746
+ 'email ' =>
'émâí[email protected] ' ,
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âí[email protected] ' ,
$ customer->
getEmail ());
756
+ $ this ->assertNotEquals ('random_token_123 ' , $ customer ->getRpToken ());
757
+ }
735
758
}
0 commit comments