Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
migration system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Jan 2017 at 15:59 UTC
Updated:
27 Mar 2017 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joachim commentedThe plugins array is not keyed numerically, so getting the order of the failing plugin would require a bit more work. I reckon giving the plugin ID should be enough.
Comment #3
mikeryanWhile we're at it, "got" isn't very elegant English here... Maybe we can change it to "received"?
That's a nit - needs work because needs tests. Given that the tests passed, that suggests this exception is not currently tested, good opportunity to add one...
Thanks!
Comment #4
jofitzAdded test.
Comment #6
phenaproximaThis would be a big usability win for Migrate. Kicking it up a notch.
Comment #7
phenaproximaSelf-assigning for review.
Comment #9
phenaproximaCan this be changed to use Prophecy? It's a lot more readable. If we don't want to switch to Prophecy, we should have comments to improve grokkability.
Rather than try/catch, let's take advantage of PHPUnit's @expectedException and @expectedExceptionMessage annotations.
Comment #10
jofitzgetMock()toprophesize()for improved readability.@expectedExceptionand@expectedExceptionMessage- what an awesome, elegant code structure. Love it! @phenaproxima++Comment #11
phenaproximaOne tiny thing, for brevity's sake. This can be rewritten:
Let us change it to that, and then this is good to go! Excellent work, @Jo Fitzgerald. Thank you!
Comment #12
jofitzDone - much nicer!
Comment #14
jofitzTypo!
Comment #15
phenaproximaGlorious.
Comment #17
jofitzSeems to have been a testbot glitch, back to RTBC.
Comment #19
tameeshb commentedPatch applies cleanly, not sure why the testbot says "PHP 5.6 & MySQL 5.5 Patch Failed to Apply"
Comment #20
jofitzPatch did not apply for me so re-rolled.
Comment #21
jofitzResetting to RTBC in expectation.
Comment #22
alexpottWe don't use annotations for this anymore. See #2822837: Replace @expectedException @expectedExceptionMessage with $this->setExpectedException.
Comment #23
jofitzReplaced @expectedException, @expectedExceptionMessage with $this->setExpectedException.
phenaproxima-- for misleading me :p
Comment #24
phenaproximaHey now, this is news to me as well! :) Having just now glanced at the issue linked by @alexpott, the rationale for using setExpectedException() makes sense to me. I don't agree that it should always be used -- like if unit testing a single method that will throw an exception on failure -- but the decision has been made and I will abide by it.
Preemptively back to RTBC assuming the tests pass.
Comment #25
alexpottCommitted and pushed 2421ca2 to 8.4.x and 0fdb7f3 to 8.3.x. Thanks!
Backported to 8.3.x as migrate is experimental and this is helpful.