Problem/Motivation

When running a test that triggers an error with the severity E_USER_DEPRECATED or E_DEPRECATED the test suite crashes with the following fatal error:

Notice: Undefined offset: 16384 in /var/lib/drupaltestbot/sites/default/files/checkout/modules/simpletest/drupal_web_test_case.php on line 545
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'message_group' cannot be null' in /var/lib/drupaltestbot/sites/default/files/checkout/includes/database/database.inc:2168

These codes were only intruduced in PHP 5.3.0 and although included in drupal_error_levels() (API) they are not supported by DrupalTestCase::errorHandler() (API).

To reproduce, test any code with

trigger_error('Message', E_USER_DEPRECATED);

in it. For example, this patch: #2090987: Provide methods on the Party entity to access data sets (#14)

Proposed resolution

Add E_DEPRECATED and E_USER_DEPRECATED to DrupalTestCase::errorHandler() and set to bo "Run-time notice"

CommentFileSizeAuthor
#3 2101235-3.patch1.24 KBrlmumford
#2 2101235-2.patch619 bytesrlmumford
#1 2101235-1.patch622 bytesrlmumford

Comments

rlmumford’s picture

Status: Active » Needs review
StatusFileSize
new622 bytes

Here's a test that will do nothing on servers running PHP 5.2 but will fail on PHP 5.3

rlmumford’s picture

StatusFileSize
new619 bytes

There was a typo in that one. (Embarrassing). Here's the test. The patch should fail.

rlmumford’s picture

StatusFileSize
new1.24 KB

This one has the fix in it. The test still doesn't pass, but I don't know how to set the error handler in a way that will detect the 500 error thrown but not detect it otherwise.

Status: Needs review » Needs work

The last submitted patch, 2101235-3.patch, failed testing.

pfrenssen’s picture

Status: Needs work » Closed (duplicate)

This is a duplicate of #2054205: Broken Tests on PHP 5.5 which already has been committed to D8 and has a backport for D7.