Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
migration system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
20 Jun 2014 at 01:06 UTC
Updated:
22 Jan 2015 at 13:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alexpottCan we add some tests for the issue addressed in #2181775: SQL idmap broke when using separate mysql users for source and destination
Comment #2
benjy commentedI had a go at unit testing runQuery() before and gave up. There is a lot going on in SqlBase::runQuery() and it would mean mocking quite a few things.
Could we get away with just testing mapJoinable(), that would probably be easier?
Comment #3
benjy commentedAdded a unit test for mapJoinable(). Unit tests sure get complicated quick when you have a bit of mocking going on.
Comment #5
benjy commentedDoh!
Comment #6
benjy commentedComment #7
ultimikeEverything looks good - just a minor comment and a question.
Thanks,
-mike
Minor - extra linefeed.
I'm not sure I understand why this assertion fails the first time and works the second time...
Comment #8
benjy commented1. Removed the white space.
2. Yes, that is a little bit of PHPUnit black magic. As you can see here, $this->at(0), $this->at(1) has different values, which means a different value is returned from the method the second time it is called.
Comment #9
benjy commentedPath in #8 seemed to have a few extra things so new patch attached.
Comment #10
benjy commented@chx wasn't so happy with the readability of the test so i've refactored the creation of the TestSqlBase into another method and added parameters to define how that is setup rather than relaying on ->at(0), ->at(1) etc.
Comment #11
benjy commentedDiscussed on IRC, made number of calls more specific.
Comment #12
chx commentedLet's do this.
Comment #13
alexpottWhy is this not just extending UnitTestCase - I can't see why it needs MigrateTestCase
This could be a dataprovider to getSqlBase - which would need to be changed to a test and have an assertion.
Comment #14
benjy commentedComment #15
chx commentedThat's really great, let me resurrect the comments however, those were useful. Did very minor cleanup as well.
Comment #18
benjy commentedFails were unrelated.
Comment #20
chx commentedBack to where it belongs...
Comment #21
webchickLooks like Alex was looking into this one.
Comment #24
daffie commentedAnd again back to RTBC.
Comment #25
alexpottMigrate changes are unfrozen as part of beta evaluation. Committed ca51249 and pushed to 8.0.x. Thanks!