File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
dev/tests/integration/testsuite/Magento/Customer/_files Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ use Magento \Customer \Api \AddressRepositoryInterface ;
9
+ use Magento \Framework \Exception \NoSuchEntityException ;
10
+ use Magento \Framework \Registry ;
11
+ use Magento \TestFramework \Helper \Bootstrap ;
12
+
13
+ /** @var Registry $registry */
14
+ $ registry = Bootstrap::getObjectManager ()->get (Registry::class);
15
+ $ registry ->unregister ('isSecureArea ' );
16
+ $ registry ->register ('isSecureArea ' , true );
17
+
18
+ /** @var AddressRepositoryInterface $addressRepository */
19
+ $ addressRepository = Bootstrap::getObjectManager ()->get (AddressRepositoryInterface::class);
20
+
21
+ foreach ([1 , 2 ] as $ addressId ) {
22
+ try {
23
+ $ addressRepository ->deleteById ($ addressId );
24
+ } catch (NoSuchEntityException $ e ) {
25
+ /**
26
+ * Tests which are wrapped with MySQL transaction clear all data by transaction rollback.
27
+ */
28
+ }
29
+ }
30
+
31
+ $ registry ->unregister ('isSecureArea ' );
32
+ $ registry ->register ('isSecureArea ' , false );
You can’t perform that action at this time.
0 commit comments