Problem/Motivation
Writing a contrib test, it's useful to use MigrateDrupal6TestBase. The problem is you can't substitute your own fixture, forcing you to use MigrateDrupalTestBase.
Proposed resolution
Allow subclasses to change the fixtures.
Remaining tasks
Patch.
User interface changes
None.
API changes
Additional protected property that can change.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2748467-migrate-subclass-fixtures-10.patch | 1.43 KB | sam152 |
| #2 | 2748467-migrate-subclass-fixtures-2.patch | 1.53 KB | sam152 |
Comments
Comment #2
sam152 commentedComment #4
mikeryanSam152, do you really need to substitute the entire fixture, or just to make small modifications to it? For the latter, please take a look at MigrateDumpAlterInterface::migrateDumpAlter().
Comment #5
sam152 commentedWorking with a DB connection object to create new fields seems very non-trivial. Why is should core be given the Drupal UI as a tool for creating fixtures and contrib authors need to cherry-pick the various and very specific DB insertions/alterations required to achieve the same results?
Comment #7
benjy commentedThis seems like a simple improvement to make things easier for contrib. We do not want to recommend MigrateDumpAlterInterface, that was added for a special case on the file migration, if anything it would be nice to remove that interface in the future.
Looks like the patch fails because of a syntax error otherwise +1 from me for RTBC.
Comment #8
sam152 commentedExpressions aren't allowed as property defaults. Worth moving into it's own protected method? ::loadDrupal6Fixture ::loaDrupal7Fixture?
Comment #9
benjy commentedYeah we lets add a method.
Comment #10
sam152 commentedComment #11
benjy commentedThese should be "Gets", prob fix on commit.
Comment #12
alexpottCommitted 32b60ac and pushed to 8.1.x and 8.2.x. Thanks!
Committed to 8.1.x as well because migrate is experimental and this is about testing.
Fixed on commit.