Skip to content

Commit 5e5ed1b

Browse files
committed
Tests data rollback for
1 parent 6cc68c6 commit 5e5ed1b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,19 @@ public function testCreateCustomerIfPassedAttributeDosNotExistsInCustomerInput()
237237
QUERY;
238238
$this->graphQlQuery($query);
239239
}
240+
241+
public function tearDown()
242+
{
243+
/** @var \Magento\Framework\Registry $registry */
244+
$registry = Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
245+
$registry->unregister('isSecureArea');
246+
$registry->register('isSecureArea', true);
247+
$customersCollection = Bootstrap::getObjectManager()->create(\Magento\Customer\Model\Customer::class);
248+
foreach ($customersCollection as $customer) {
249+
$this->customerRepository->deleteById($customer->getId());
250+
}
251+
$registry->unregister('isSecureArea');
252+
$registry->register('isSecureArea', false);
253+
parent::tearDown();
254+
}
240255
}

0 commit comments

Comments
 (0)