From 4793553bff78989c06d4e7bfd321ff5c786eeb4d Mon Sep 17 00:00:00 2001 From: Valeriy Nayda Date: Tue, 11 Sep 2018 18:44:48 +0300 Subject: [PATCH] GraphQL-172: GraphQL modules delivery -- add block_rollback fixture --- .../Magento/Cms/_files/block_rollback.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Cms/_files/block_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Cms/_files/block_rollback.php b/dev/tests/integration/testsuite/Magento/Cms/_files/block_rollback.php new file mode 100644 index 0000000000000..9214dd543bd31 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Cms/_files/block_rollback.php @@ -0,0 +1,30 @@ +get(BlockRepositoryInterface::class); + +/** @var SearchCriteriaBuilder $searchCriteriaBuilder */ +$searchCriteriaBuilder = $objectManager->get(SearchCriteriaBuilder::class); +$searchCriteria = $searchCriteriaBuilder->addFilter(BlockInterface::IDENTIFIER, 'fixture_block') + ->create(); +$result = $blockRepository->getList($searchCriteria); + +/** + * Tests which are wrapped with MySQL transaction clear all data by transaction rollback. + * In that case there is "if" which checks that "fixture_block" still exists in database. + */ +foreach ($result->getItems() as $item) { + $blockRepository->delete($item); +}