Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
6 Sep 2011 at 16:04 UTC
Updated:
19 Mar 2017 at 23:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
matason commentedAttaching the patch...
Comment #2
catchThis should be added as phpdoc for getInfo() as well.
Otherwise looks great.
API addition so needs a change notification once it's in.
Comment #3
dave reidWhy not just wrap the test class itself in
function_exists('gzopen') { // Class definition }?Comment #4
dave reidComment #5
matason commentedI am just wondering whether 'requirements' is right and perhaps even whether there's a clean way of incorporating these function_exist() checks into 'dependencies' as this is what we're really talking about.
Comment #6
catchAlso what about returning a flag from getInfo() rather than array of function names. I could see checks for ini_get, classes and other stuff that's not functions being useful here.
Comment #7
dave reidLet's just make an access static function for tests that gets called and returns a TRUE/FALSE value.
This or give a way for tests to stop executing in setUp() gracefully.
Comment #8
btmash commentedI like the suggestion from #7 since adding in the check is actually quite easy (it can be added to DrupalTestCase so then any other type of tests that are subclasses of DrupalTestCase can also get checked for access) and any test that requires any additional requirements can implement their check fairly easily. I tested this out and got tests to appear/disappear as necessary. Attaching patch.
Comment #9
btmash commentedAck...whitespace. Attaching new patch.
Comment #10
chx commentedWe dont want this apparently.
Comment #11
matason commentedTo elaborate on why we don't want this: It was decided by discussion on IRC (@webchick, @chx, @davereid, @xjm) that it would be better to have tests fail with a message about unmet requirements such as zlib than have tests silently not run at all.
Comment #12
xjmComment #13
mile23Followup that never got linked from here: #1273478: Implement @requires and @dependencies within TestBase, mark tests as skipped