Closed (fixed)
Project:
Metatag
Version:
8.x-1.x-dev
Component:
Tests
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jan 2020 at 17:49 UTC
Updated:
10 Apr 2020 at 16:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
antongp commentedHere is a patch which changes visibility to protected.
Child classes should also be able to override properties like
$testTag,$testNameAttribute, etc., so, their visibility also changed to protected.In addition to properties, "hook" methods like
{tag_name}TestKey(),{tag_name}TestValue(), etc., should also be defined as protected (or public) to be invoked from the parent class.\Drupal\Tests\metatag\Functional\MetatagTagsTestBase::getTestTagName()method visibility needs to be changed as well since it is overridden in several child classes.\Drupal\Tests\metatag\Functional\MetatagTagsTestBase::randomImageUrl()method visibility needs to be changed too since it is called is some of child classes.\Drupal\Tests\metatag\Functional\MetatagTagsTestBase::getTestTagValue()doesn't seem to be used or overridden, but its purpose is similar to previous 2 methods, so I think it should not be private too.\Drupal\Tests\metatag\Functional\MetatagTagsTestBase::getMethodFromTagCallback()method visibility (private) is not changed by the patch.After fixing visibility, some of tests failed with "Cannot use object of type Behat\Mink\Element\NodeElement as array" error, so I tried to fix this as well (please pay more attention to this change).
Note: the patch does not try to fix tests which assertions fail on run now (just because they weren't executed before), it tries to fix
\Drupal\Tests\metatag\Functional\MetatagTagsTestBasebase class and visibility of properties and methods in child classes.Another base class
\Drupal\Tests\metatag\Functional\MetatagFieldTestBasedoesn't seem to have such issues. Didn't check other classes in details though.Comment #3
antongp commentedComment #5
damienmckennaLet's fix this for the next release.
Comment #6
damienmckenna@antongp: Thanks for uncovering this and putting the patch together, it's appreciated.
Comment #7
damienmckennaThis fixes the tests for the primary module, the submodules still need to be fixed.
Comment #9
damienmckennaOne down, 11 more to go!
Comment #10
damienmckennaWorking on this some more.
Comment #11
damienmckennaLet's see how close this is.
Comment #12
damienmckennaWoohoo!
Comment #13
damienmckennaCommitted. Thanks @antongp!
Comment #15
damienmckennaComment #17
antongp commentedHi @DamienMcKenna
Sorry for late question, but I've just noticed that
testTagsInputOutput()method was renamed to_testTagsInputOutput()(with underscore) in the commit. Not sure, but did this happen by intent or by accident?Thanks in advance!
Comment #18
damienmckennaWhoops! Yes indeedy, I temporarily disabled that test while working on the fix but forgot to reenable it.
Let's reenable it.
Comment #20
damienmckennaPer @quietone:
Comment #21
lendudeMoving the tag iteration to a dataProvider. This will blow up the total run time, but it might help pinpoint the points of failure to specific tags.
og_image tag just took away 20GB of disk space locally and then crashed, so that might be one :D
Comment #23
damienmckennaOh! Nice! That's fantastic, thank you!
This fixes the metatag_open_graph_products tests.
Comment #25
damienmckennaComment #26
damienmckennaLet's see if this works. In the interest of time I some specific meta tags that we can deal with separately.
Comment #27
damienmckennaI created #3122948: Fix @todo notes in tag test files as a follow-on for finishing some of the individual tags that were broken.
Comment #28
damienmckennaCommitted. Thank you so much, Lendude, for helping, that made it significantly easier to find the problems.
Comment #30
damienmckennaComment #31
lendudeHappy to help :)