This repository was archived by the owner on May 27, 2023. It is now read-only.
Fixes for foreign key checks, arbitrary tables and disabled indexers #146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are three problems I ran into with some fixtures which are addressed by this pull request:
If the fixtures have rows for tables with foreign key constraints like ON DELETE RESTRICT then cleaning and applying the fixtures fails since the parent table is deleted before the child table. The first commit in the pull request fixes this by deleting the table data in reverse order.
Some tables in Magento don't have "entities" defined in the config. When you try to use one of these in a fixture (e.g. "catalog_product_entity_varchar") you get the error:
Can't retrieve entity config: ecomdev_phpunit/catalog_product_entity_varchar
Setting the _resourceModel property causes this to be resolved to the correct table without an error.