Postponed (maintainer needs more info)
Project:
Drupal core
Version:
main
Component:
block.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
27 Dec 2012 at 12:59 UTC
Updated:
10 Jun 2026 at 17:23 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xjmComment #2
xjmComment #2.0
xjmRemoving myself from the author field so that I can unfollow the issue. --xjm
Comment #3
steeloctopus commentedComment #4
steeloctopus commentedI have added a test to the BlockBaseTest. I'm fairly new to writing PHPUnit test so I would like some feedback to ensure I'm doing this correctly for the tests. Once I get confirmation I will carry on with writing more test for the BlockBase class.
Comment #5
yesct commentedwe talked in irc during core office hours (well, *after* core office hours. :) ) making some notes here about what we talked about.
some coding style stuff
tim also said the constructor doesn't need a dedicated test (if it does, it's doing too much. the usual setting a few things and calling a function are fine and dont need a dedicated test).
probably some confusion from the comment on the testGetConfiguration method. That can just say it's testing getConfiguration and doesn't need to mention it's testing the constructor. It just happens to deal with the constructor, but is not a dedicated test for that.
I wondered if might be worth doing something to set a label, and have a test that checks the getConfiguration() returns the right label (and not just '' after the construction) might be worth doing.
Not sure how to decide what should be tested, might have to look into what $configuration is deeper.
the issue is kind of old. it says "Add a test implementation of the BlockBase class. " ...
since then, is there already a test implementation?
would that be the BlockBaseTest class?
if so, would be good to find the issue that did that, (git blame on that class should do that)
and update the issue summary to say what issue already did that and it's not needed as part of this issue anymore.
(ah, I see this issue will eventually add more tests for more (all?) of the methods in BlockBase)
---
So I think a patch and interdiff with some quick easy fixes is probably the next step.
Then after that, looking at some more phpunit test examples, and posting another patch (and interdiff) for some things discovered by looking at those examples.
Then getting someone experienced with phpunit to take a look and provide some more guidance.
Comment #6
xjmSetting NR since there is a start at a patch here.
Comment #10
tim.plunkettNot actively part of the Blocks-Layouts work.
Comment #22
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #24
smustgrave commentedAll the related issues are closed so should this be too? @xjm?