Follow up for #2027587: Add tests for custom blocks, contact forms, formats, shortcut listings and settings pages.
Updated: Comment #0
Problem/Motivation
Since the two tests issues have been committed,
#2027587: Add tests for custom blocks, contact forms, formats, shortcut listings and settings pages.
and
#2004710: Add tests for block, menu, vocabulary and views listings
@alexpott pointed out that the call to the procedural function strtolower from the class, should actually just directly call the OO method that it is a wrapper for. This will allow the dependencies to be lazy loaded. (We can check for these kind of things if using an IDE like phpstorm by right clicking on procedural functions in classes and seeing if they are simple wrappers around other class methods.)
Also, there is some comment cut and pasted that is
// Set the machine name so later the translate link can be build.
build should be built.
See: #2027857: Blocks operations cannot be altered for an example of the use to be added and how to call the method strtolower.
Also, the setUp should be public, and the tests should be public.
see the simpletest standards: https://drupal.org/node/325974
Proposed resolution
use
Unicode::strtolower($this->randomName(16));
and fix the grammar.
Remaining tasks
- create patch
User interface changes
No.
API changes
No.
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#8 | clean-up-added-tests-2028067-8.patch | 4.65 KB | David Hernández |
#8 | interdiff.txt | 519 bytes | David Hernández |
#6 | clean-up-added-tests-2028067-6.patch | 4.83 KB | David Hernández |
#6 | interdiff.txt | 679 bytes | David Hernández |
#5 | clean-up-added-tests-2028067-5.patch | 4.49 KB | David Hernández |
Comments
Comment #0.0
YesCT CreditAttribution: YesCT commentedclarified it's the dependencies that can be autoloaded.
Comment #1
David Hernández CreditAttribution: David Hernández commentedI think that's what is needed.
Comment #2
Gábor HojtsyI think later should go later. As in "can be built later" not "later... can be built".
@YesCT also says this appears in multiple places, not just this one.
The newline should be kept at the end of the file :)
Comment #3
David Hernández CreditAttribution: David Hernández commentedOk, I fixed the comment, added the newline and replaced the rest of strtolower functions I found.
Comment #5
David Hernández CreditAttribution: David Hernández commentedRe-rolling
Comment #6
David Hernández CreditAttribution: David Hernández commentedMissed one change after the reroll. Here's the correct one.
Comment #7
vijaycs85All good except one minor.
Needs a line here as per https://drupal.org/node/608152#indenting. otherwise, it is RTBC for me.
Comment #8
David Hernández CreditAttribution: David Hernández commentedFixed. Thanks!
Comment #9
vijaycs85#8 looks good to me.
Comment #10
Gábor HojtsyYay, thanks, committed.
Comment #11.0
(not verified) CreditAttribution: commentedadding another clean up for public methods in the test.