The Panels tests break with the latest -dev of CTools due to this change #2639526: Calling BlockDisplayVariant::setConfiguration() won't change results returned from plugin collections which cause the plugin collections to get initialized when setting configuration. The problem is that the plugin managers aren't injected - they're pulled off the container! Which makes it impossible to unit test any class that descends from BlockDisplayVariant.

So, we need to inject those plugin managers, and also, we need to set all the dependencies before calling the parent constructor so that they can be used in the configuration functions that are called by the parent constructor.

I'm marking this as a bug because it's breaking the Panels tests.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Status: Active » Needs review
FileSize
0 bytes

Here's the patch! Apparently, someone (maybe even me?) made similar changes in the tests so that we could even test BlockDisplayVariant at all - this patch removes that because the same basic fix is part of BlockDisplayVariant itself now. :-)

dsnopek’s picture

Er, crap, a 0 byte patch. :-/ Here's the real patch!

The last submitted patch, 2: ctools-blockdisplayvariant-dependencies-2642786-2.patch, failed testing.

dsnopek’s picture

Title: Improve dependency injects in BlockDisplayVariant » Improve dependency injection in BlockDisplayVariant

  • EclipseGc committed 4f784d3 on 8.x-3.x authored by dsnopek
    Issue #2642786 by dsnopek: Improve dependency injection in...
dsnopek’s picture

Status: Needs review » Fixed

Thanks!

dsnopek’s picture

Status: Fixed » Needs review
FileSize
652 bytes

Eep! Actually, I messed this up a little bit - this was missing the change to ::create(). Sorry!

dsnopek’s picture

Bah, apparently, I messed up more stuff than that. :-/ This actually works my manual testing. This is what we get for having unit tests for this but not functional tests!

EclipseGc’s picture

Status: Needs review » Fixed

  • EclipseGc committed 81b29b1 on 8.x-3.x authored by dsnopek
    Issue #2642786 by dsnopek: FIX: Improve dependency injection in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.